Integrate license with client

Prev Next

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
    contentId String Required
    drmType String Required
    responseFormat String Required
    userId String Required
    • 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 response 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.