Documentation Index

Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

Integrate license with client

Prev Next

The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.

Available in Classic and VPC

This guide describes examples of integrating a DRM license with the client (player).

Note
  • License issuance request information varies depending on the DRM type. See the license issuance guide for each DRM type.
  • 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.
  • The One Click Multi DRM service supports easy integration with NAVER Cloud's Video Player Enhancement (VPE) service. For more information, see Authenticate VPE content.

Request

This section describes the request format.

Request headers

For information about the headers common to all One Click Multi DRM APIs, see One Click Multi DRM request headers.

Create X-DRM-TOKEN header

To issue a license via API in the One Click Multi DRM service, the X-DRM-TOKEN header is required. This header validates the requesting user's permissions and is used to issue a DRM license based on the security policy of the selected site. If the header value is invalid, the license will not be issued. The following describes how to create the X-DRM-TOKEN header.

  1. Enter the JSON data for siteId, contentId, drmType, responseFormat, and userId.
    Field Type Required Description
    siteId String Required Site ID for license issuance
    contentId String Required Unique identifier of the content to play
    • Enter 3-100 characters using a combination of English letters, numbers, and special characters "-" and "_".
    • Enter the multi-DRM content ID value set for the channel in the Live/VOD Station service.
    drmType String Required DRM type requesting license
    • WIDEVINE | PLAYREADY | FAIRPLAY
    responseFormat String Required Response data format
    • ORIGINAL (default) | JSON
      • ORIGINAL: Respond with the requested binary data. Support format for common multi-DRM integrate clients (HTML5, Video.js, Shaka)
      • JSON: Respond with JSON containing license data and additional information (such as the client device ID). It is applicable only when using a token proxy or client SDK.
    userId String Required Unique ID of the user attempting to play the content
    • User ID managed by the service site or user account that will play DRM content
    • Input example
      {"siteId":"{Site ID}","contentId":"{Content ID}","drmType":"{DRM type}","responseFormat":"{Response format}","userId":"{Unique user ID}"}
      
  2. Convert the JSON data into a Base64 string.
    • Conversion example
      eyJzaXRlSWQiOiJkcm0tMjAyMzExMTUxNDIzMjYtbkh5TnciLCJjb250ZW50SW...dXNlcklkIjoiZDQxZDhjZDk4ZjAwYjIwNGU5ODAwOTk4ZWNmODQyN2UifQ==
      
Note

Make sure to avoid including unnecessary spaces or line breaks when entering JSON data.

Request example

The request example is as follows:

//Widevine license request example
'com.widevine.alpha': {
    src: 'https://uz1urqjj2471.beta-edge.naverncp.com/live/video/ls-20231031105925-*****/live.mpd', //DRM-encrypted content playback path
    licenseUri: 'https://multi-drm.apigw.ntruss.com/api/v1/license', //DRM license issuance request path
    licenseRequestHeader: {
        'X-NCP-REGION_CODE': 'KR',
        'X-ncp-apigw-timestamp': 1698832564997,
        'X-ncp-iam-access-key': 'ft1GKEpjSc**********',
        'x-ncp-apigw-signature-v2': 'Z0LjTbqFjWtxlRskM8vDj**********************=',
        'X-DRM-TOKEN': 'eyJyZXNwb25zZUZvcm1hdCI6Im9yaWdpbmFsIiwic2l0ZUlkIjoiZHJtLTIwMjMxMTAxMDgyMzE2LWRKREdhIiwiY29udGVudElkIj**************************************************'
    }   //Required authentication for APIGW and X-DRM-TOKEN header value for utilizing One Click Multi DRM service
},

//PlayReady license request example
'com.microsoft.playready': {
    src: 'https://uz1urqjj2471.beta-edge.naverncp.com/live/video/ls-20231031105925-*****/live.mpd', //DRM-encrypted content playback path
    licenseUri: 'https://multi-drm.apigw.ntruss.com/api/v1/license', //DRM license issuance request path
    licenseRequestHeader: {
        'X-NCP-REGION_CODE': 'KR',
        'X-ncp-apigw-timestamp': 1698832564997,
        'X-ncp-iam-access-key': 'ft1GKEpjSc**********',
        'x-ncp-apigw-signature-v2': 'Z0LjTbqFjWtxlRskM8vDj**********************=',
        'X-DRM-TOKEN': 'eyJyZXNwb25zZUZvcm1hdCI6Im9yaWdpbmFsIiwic2l0ZUlkIjoiZHJtLTIwMjMxMTAxMDgyMzE2LWRKREdhIiwiY29udGVudElkIj**************************************************'
    }   //Required authentication for APIGW and X-DRM-TOKEN header value for utilizing One Click Multi DRM service
},

//FairPlay Streaming license request example
'com.apple.fps': {
    src: 'https://uz1urqjj2471.beta-edge.naverncp.com/live/video/ls-20231031105925-*****/playlist.m3u8', //DRM-encrypted content playback path
    certificateUri: 'https://multi-drm.apigw.ntruss.com/api/v1/license/fairPlay',  //Path for requesting the FPS certificate required for issuing DRM license
    certificateRequestHeader: {
        'X-NCP-REGION_CODE': 'KR',
        'X-ncp-apigw-timestamp': 1698832564997,
        'X-ncp-iam-access-key': 'ft1GKEpjSc**********',
        'x-ncp-apigw-signature-v2': 'Z0LjTbqFjWtxlRskM8vDj**********************=',
        'X-DRM-TOKEN': 'eyJyZXNwb25zZUZvcm1hdCI6Im9yaWdpbmFsIiwic2l0ZUlkIjoiZHJtLTIwMjMxMTAxMDgyMzE2LWRKREdhIiwiY29udGVudElkIj**************************************************' 
    }, //Required authentication for APIGW and X-DRM-TOKEN header value for utilizing One Click Multi DRM service
    licenseUri: 'https://multi-drm.apigw.ntruss.com/api/v1/license', //DRM license issuance request path
    licenseRequestHeader: {
        'X-NCP-REGION_CODE': 'KR',
        'X-ncp-apigw-timestamp': 1698832564997,
        'X-ncp-iam-access-key': 'ft1GKEpjSc**********',
        'x-ncp-apigw-signature-v2': 'Z0LjTbqFjWtxlRskM8vDj**********************=',
        'X-DRM-TOKEN': 'eyJyZXNwb25zZUZvcm1hdCI6Im9yaWdpbmFsIiwic2l0ZUlkIjoiZHJtLTIwMjMxMTAxMDgyMzE2LWRKREdhIiwiY29udGVudElkIj**************************************************'  
    } //Required authentication for APIGW and X-DRM-TOKEN header value for utilizing One Click Multi DRM service
}

Response

This section describes the response format.

Response status codes

For information about the HTTP status codes common to all One Click Multi DRM APIs, see One Click Multi DRM response status codes.

Response example

Upon successful response, the DRM license is integrated with the client (player) along with a 200 OK status.