Test Token Generation

This tutorial explains the two methods available for generating Test Tokens.

Requirements

  • Packaged Content
  • Content Key
  • Content ID
  • Content Location (URL)
  • Test Authenticator

Method 1

Generating Test Tokens with ExpressPlay Admin

To create an MS3 Token with the ExpressPlay Admin you must provide the token with the Content ID, Content Key and Content URL. The Content ID and Content Key are both created when packaging content; the Content URL is the hosting location of the packaged content. MS3 tokens require a special Content ID, this takes the form of urn:marlin:kid:<value> with <value> being the same hexadecimal value used for the property value when packaging content. A full Content ID for MS3 Token generation would be:  urn:marlin:kid:12341234123412341234123412341234

To create a token for a piece of media, paste the full Content ID as described above into the Content ID field, the Content Key into the Content Key field, and the Content URL into the URL field. See the working examples below.

Service Mode = Test Customer Authenticator = 793,adf05681cff44bc58ab24fadd7876e42 (change to yours) Content ID = urn:marlin:kid:67895432987623454756654729382341 Content Key = 43210987123478904321098712340987 Content URL = http://d31lwto7rjo21l.cloudfront.net/video/ExpressPlayerDASH-BBB/stream.mpd
Service Mode = Test Customer Authenticator = 793,adf05681cff44bc58ab24fadd7876e42 (change to yours) Content ID = bigbuckbunnyhls Content Key = 12345678123456781234567812345678 Content URL = hls://d31lwto7rjo21l.cloudfront.net/video/HLSBBB/master.m3u8

For BB tokens, the required fields are a bit different. You don't need the content URL, but you do need to include a rightsType parameter which can be BuyToOwn or Rental.

Service Mode = Test Customer Authenticator = 793,adf05681cff44bc58ab24fadd7876e42 (change to yours) Content ID = bigbuckbunnyhls Content Key = 12345678123456781234567812345678 tokenType = BuyToOwn actionTokenType = 1

Note: In the case of HLS content, you use the 'hls://' protocol identifier in the contentURL parameter. For DASH and MP4, you use http or https as appropriate. In the case of the HLS example above you should get a token similar to the one below

https://ms3.test.hostedmarlin.com:8443/hms/ms3/rights/?b=ABEAAwAAAzkAB2dpbGRyZWQ_eAAQpFUJY-8_OCZ5wYY6y2gAmABQkInGCpdtGEh3za2455x3QGYTXyuDsz8pmwOWJWyPPT3mH2AGv89GD-Ym6si8I_GCgn6LwZScs9YgyrLQiTwDcdMfNOLxjlh8_5YXMNdTW-4AAAAUN6OKj0O7JPT1aKnnLX1md52iL8k#hls%3A%2F%2Fd31lwto7rjo21l.cloudfront.net%2Fvideo%2FHLSBBB%2Fmaster.m3u8

Method 2

Generating Test Tokens with the REST API

Full API documentation can be found here. This guide demonstrates the MS3 Token Request API which requires your Test Authenticator, found at admin.china.expressplay.cn, the content key used to encrypt the piece of content, the content's property <value> used when packaging the content, and the content hosting location in URL form. This information is formatted into a RESTful POST or GET request similar to the one demonstrated below.

Note: The Test Authenticator is used as the customerAuthenticator value in the REST API as demonstrated below using the same parameters as the ExpressPlay Admin example for DASH.

https://ms3-gen.test.expressplay.com/hms/ms3/token?customerAuthenticator=793,adf05681cff44bc58ab24fadd7876e42&contentId=urn:marlin:kid:67895432987623454756654729382341&contentKey=43210987123478904321098712340987&contentURL=http://d31lwto7rjo21l.cloudfront.net/video/ExpressPlayerDASH-BBB/stream.mpd

Note: In the case of HLS content, you should use the 'hls://' protocol identifier in the contentURL parameter. For DASH and MP4, you use http or https as appropriate. In the case of the DASH example above you should get an MS3 token similar to the one shown below.

https://ms3.test.hostedmarlin.com:8443/hms/ms3/rights/?b=AAwAAwAAAxkAAlRXPGAAECBR0l7K6dxdkxUSrLNplXUAcDb87DeJyouvcWEmW_-VnmUCGj3vNRJP5f3R_455AWnHcflhQYwJ-O1XUvJYJGK_xtVeEXdJ6DFnwSyo5sRo0ewSCcp-S3MDZGtH2KvXzPBawG45q-VUIc9h2qBpjlnbmqzDkSXpNDm8SwKE0v2MzY0AAAAU6O8AXt97WK0NMFGHgfcAidReoRE#http%3A%2F%2Fd31lwto7rjo21l.cloudfront.net%2Fvideo%2FExpressPlayerDASH-BBB%2Fstream.mpd

And for BB tokens the base url is a bit different, and the parameters are same as the above BB example with the addition of a required actionTokenType=1 parameter to indicate that this is for a BB license token.

https://bb-gen.test.expressplay.com/hms/bb/token?customerAuthenticator=793,adf05681cff44bc58ab24fadd7876e42&contentId=urn:marlin:kid:67895432987623454756654729382341&contentKey=43210987123478904321098712340987&rightsType=BuyToOwn&actionTokenType=1