Issue Widevine, PlayReady license

Prev Next

This is an API for issuing licenses issued through the One Click Multi DRM product.
This guide describes the Widevine and PlayReady DRM license issuance APIs, and FairPlay DRM licenses are provided by the Issue FairPlay streaming license API.

Note

The following are the license issuance precautions.

  • The site must be activated after the site creation is completed to issue the license.
  • All licenses issued through One Click Multi DRM are issued on the assumption that DRM encryption packaging is ready.
  • One Click Multi DRM supports binary type (ORIGINAL) and JSON license responses.
  • To use the license issued by One Click Multi DRM, you must request a license through apigw, including the X-DRM-TOKEN header.
  • For the value to be included in the X-DRM-TOKEN header, enter the value of the JSON data converted to a Base64 string.
  • In the One Click Multi DRM product, the X-DRM-TOKEN header is used to verify that the user is an authorized user of the content and the site, and the DRM license rules are set according to the content security policy set on the requested site.
  • One Click Multi DRM supports easy integration with the Video Player Enhancement product of NAVER Cloud.
  • All license requests must be made through the player implementation and the device information of the terminal on which the DRM content will be played.
Caution
  • One Click Multi DRM product checks the validity of the X-DRM-TOKEN header and issues a license that matches the selected site settings. If the header value is invalid, the license will not be issued.
  • The license response type should be selected according to the player's license parsing type.
    For clients that only support general multi-DRM integration, such as HTML5 players, license responses are usually supported as ORIGINAL.
  • The One Click Multi DRM product supports the registration of FairPlay Streaming certificates, but does not support the issuance of new certificates. You must obtain the FPS certificate directly from Apple. For more information, see the guide: FairPlay Streaming License Issuance{target=_blank}
  • The One Click Multi DRM product supports the issuance of token proxies by DoveRunner (formerly PallyCon). For more information on how to issue token proxies, see the guide: DoveRunner (formerly PallyCon) Token Proxy-based License{target=_blank}
  • Validity checks are not supported for FairPlay Streaming certificates uploaded to the One Click Multi DRM product.
  • The X-DRM-TOKEN header for requesting One Click Multi DRM licenses must include the userId, which is the unique ID of the user who will play the content (the user ID managed by the service site or the user account that will use the DRM content).
  • The contentId to be included in the X-DRM-TOKEN header for requesting One Click Multi DRM licenses must be the same as the CID used for the content's DRM packaging. e.g., Enter the same value as the contentId entered in Live Station's DRM settings.
  • Requesting One Click Multi DRM licenses using Video Player Enhancement is only supported in versions 1.1.1 and later.

Request

POST https://multi-drm.apigw.ntruss.com/api/v1/license

Request headers

Header name Required Description
x-ncp-apigw-timestamp YES This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
Request is considered invalid if the timestamp differs from the current time by more than 5 minutes.
x-ncp-apigw-timestamp:{Timestamp}
x-ncp-iam-access-key YES Value of access key ID issued in the NAVER Cloud Platform portal
x-ncp-iam-access-key:{Sub Account Access Key}
x-ncp-apigw-signature-v2 YES Signature encrypted with the access key ID value and secret key
x-ncp-apigw-signature-v2:{API Gateway Signature}
Content-Type YES Specify the request body content type as application/JSON.
Content-Type: application/json
x-ncp-region_code YES Region code (KR)
x-drm-token YES Encrypted token value containing the required data for issuing One Click Multi DRM licenses
x-drm-token:{X-DRM-TOKEN}

x-drm-token header

X-DRM-TOKEN header authentication is required to issue licenses through the One Click Multi DRM API.
For the X-DRM-TOKEN header value, enter the value of the following JSON data converted to a Base64 string.

  • In the One Click Multi DRM product, the X-DRM-TOKEN header is used to verify that the user is an authorized user of the content and the site, and the DRM license rules are set according to the content security policy set on the requested site.
Field name Required Valid value Description
siteId YES Site ID for license issuance
contentId YES Unique ID of the content to play
It is the value used when packaging the DRM (content ID value included in the XML body when requesting the CPIX API). You can enter a minimum of three characters, and a maximum of 100 characters, including English letters/numbers, "-" (hyphen), and "_" (underscore).
drmType YES WIDEVINE
PLAYREADY
FAIRPLAY
DRM type requesting license
responseFormat YES ORIGINAL
JSON
Type of response data for license requests (default: ORIGINAL)
* ORIGINAL: Respond with the requested binary license data.
* JSON: Respond in JSON format, including license data and additional information (client device ID, etc.). It is applicable only when using a token proxy or client SDK.
userId Yes String Unique ID of the user who requested the license (user ID managed by the service site or user account that played the DRM content)

Create x-drm-token header

The following describes how to create an x-drm-token.

  1. Enter the siteId, contentId, drmType, responseFormat, and userId, which are required for requesting a license, in JSON.
# json
{"siteId":"drm-20231115142326-nHyNw","contentId":"my-drm-content-sample","drmType":"WIDEVINE","responseFormat":"original","userId":"d41d8cd98f00b204e9800998ecf8427e"}
  1. Encode the entered JSON data into a Base64 URL.
# Base64 Encrypted String 
eyJzaXRlSWQiOiJkcm0tMjAyMzExMTUxNDIzMjYtbkh5TnciLCJjb250ZW50SWQiOiJteS1kcm0tY29udGVudC1zYW1wbGUiLCJkcm1UeXBlIjoiV0lERVZJTkUiLCJyZXNwb25zZUZvcm1hdCI6Im9yaWdpbmFsIiwidXNlcklkIjoiZDQxZDhjZDk4ZjAwYjIwNGU5ODAwOTk4ZWNmODQyN2UifQ==
Caution

Be careful not to include blank or Return values in JSON when encoding in Base64.

Examples

Example of requesting issuance of a license with an x-drm-token header

curl -i -X POST \
   -H "x-ncp-apigw-timestamp:1505290625682" \
   -H "x-ncp-iam-access-key:D78BB444D6D3C84CA38A" \
   -H "x-ncp-apigw-signature-v2:WTPItrmMIfLUk/UyUIyoQbA/z5hq9o3G8eQMolUzTEo=" \
   -H "x-ncp-region_code:KR" \
   -H "accept: application/json" \ 
   -H "X-DRM-TOKEN: eyJzaXRlSWQiOiJkcm0tMjAyMzExMTUxNDIzMjYtbkh5TnciLCJjb250ZW50SWQiOiJteS1kcm0tY29udGVudC1zYW1wbGUiLCJkcm1UeXBlIjoiV0lERVZJTkUiLCJyZXNwb25zZUZvcm1hdCI6Im9yaWdpbmFsIiwidXNlcklkIjoiZDQxZDhjZDk4ZjAwYjIwNGU5ODAwOTk4ZWNmODQyN2UifQ==" \
'https://multi-drm.apigw.ntruss.com/api/v1/license'

Response

Note

For ORIGINAL type licenses, a binary response is provided.
No response examples are provided for binary license request responses.

JSON type license request response

Field name Required Type Description
license Yes String License JSON data
licenseCreatedTime Yes Timestamp License issuance time
tokenCreatedTime Yes Timestamp Validity time after passing the X-DRM-TOKEN header validity check
tokenExpireTime Yes Timestamp Validity time of the requested X-DRM-TOKEN header token

Response example

HTTP/1.1 200 OK
Server: nginx
Date: Fri, 20 Nov 2023 20:53:32 GMT
Content-Type: application/json;charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
x-ncp-trace-id: 36c9k60om4p3238cpmc9gm4cj4

{
  "license": "080512BF050AB9020803121044E0A85CB19D0441AC6C66B3D6ABBCC218E39FC48D06228E023082010A0282010100B2FB0D937113004C0F805C6C57DE7B266E2B5E2FE12241FF1421ED55DE2C3F73F62891D7587A8ED153F4009D9522C3609A5DC3C4E43891F8F2D7B448B36E8B77AD96DC795795706D4289F8E61FBDF564AB57E5A5EDDB64FC4EA6891C793B3FC615998CB01214D769F5BC9F93DD96D5ACB7E7239F0C3749309C55C41DD889277B28D74ADA5CB9B3F760318B55EE7FB9336283E3792EA360CC3BD32F4FDB49C4D33A5836DE3428B62D027964A989F42AB37E123BE5EFC15285090B2601F09A93AAD66546D8F85820B882A1AA3D320A8759628BB177484A660D54711FDC338DB6119E34B49F927942A343F5AD069C06DBCAF3958F83F796EAC7BF5C860B893D6CB102030100013A08696E6B612E636F6D400248011280030078BF2DF3FF6F3A488B86023BD961B3FCA718DAA38976B74620A560A8524E53C16F064CB7528F174162F331C32AA0E72296DD15BB79CA986B7739A85C7A4AB4B06D8665CDD166C58C1E030D6232AEC7970801125CC59FB988265FFFD38BD04241AAFEBB91F8C933A9E70A3B52F0FBF29306F10A2AF91B30BD3EBE24D7890778898A4999F0F7D28BFFBBD6647B08D93EDEE309C2B4B9E3080F269A1C3DE899FDA800C277EC6D0882365B1C9805D0FF4DBEB2E8BA5C51F86F910F73C1776761B85F88943E44DDCD7ABF797C4A4BE2489D6BE4FAAE4569A435E5D5E3773636EF872706F155B271D6E49D4C750A51614DBBD5D2A0F9B8E352FA91B52EC19593F215BCEB2E8401CCC9757C48793C9AB4904B93C7D326BFFBB5E24CDBF297599FB22724C95C9D40D44455586B188A6D10658BEBE5F6CE812FABB8CA58282B5D28176D5DFF3B358692CC4FC6895A06C0B90A192D65F69AE07415DCEF6E54A677D5C769BA6E9CC24E2B968BC3E6E4D4E099E446D9F7E38740DBB708023E6D35D99F1B10",
  "licenseCreatedTime": 1700476438204,
  "tokenCreatedTime": 1700476438107,
  "tokenExpireTime": 1700477038107
}