Lab
  • DRM packaging tutorialsCourse
  • 5 things you need to know about multi-DRMCourse
  • Getting started with Doverunner Anti PiracyCourse
  • Getting started with Doverunner Forensic WatermarkingCourse
  • Getting started with Doverunner Mobile App SecurityCourse
  • Getting started with Doverunner Multi-DRMCourse
  • Getting started with Doverunner Transcoding & PackagingCourse
  • Packaging content with the DRM CLI PackagerLesson · DRM packaging tutorials
한국어

Generating license tokens in Doverunner Lab

Shows how to generate and inspect DRM license tokens in the Doverunner Lab Playground, no login required.

Lesson 25 min

DRM: —Status: idle

Transcript
Create a license token in Doverunner Lab. Step 2 of the Multi-DRM quickstart. After packaging your content, you need a license token before a player can request a DRM license. You'll see how the token flow works, find your site credentials, and create a test token. Here's how it works: when a player requests playback, a license token is generated at your service site and delivered to the client. The client sends that token to Doverunner to request a DRM license — the token carries the usage rules for that request. In a real integration, your service site generates this token itself, using the Java, Python, or PHP sample code Doverunner provides. To keep this quickstart simple, we'll create a test token in the Doverunner Lab Playground instead of writing that server code. To create a license token, you need three values from Doverunner Console: your site ID, site key, and access key. Login to Doverunner Console and go to Multi-DRM Settings. To access the keys, click the 'Retrieve Secret Information' button on the page. Then open Doverunner Lab at lab.doverunner.com. Go to Playground, DRM Tools, then License policy and token tools. In the License token generator, enter your site ID, site key, and access key. Choose the DRM type for your test browser, and enter the content ID you used when packaging the test content. The timestamp fills in automatically, and the license policy JSON defaults to a minimal test policy you can leave as-is. Click Generate token. The result box gives you a Base64 token string — by default it's valid for 600 seconds, long enough to test a license request. That's how you create a license token in Doverunner Lab. In the next video, we'll cover the playback process — how a player actually uses this token to request a license.

Where this lesson fits

This is step 2 of the Multi-DRM quickstart. Your content is packaged. Before a player can get a DRM license for it, it needs a license token. In this lesson you will:

  1. Understand how the token flow works
  2. Find your site ID, site key, and access key
  3. Create a test token in Doverunner Lab

How a license token works

Multi-DRM uses token licensing. The token is how your service tells Doverunner that this viewer is allowed to play this content:

  1. The player requests playback from your service.
  2. Your service site generates a license token.
  3. The token is delivered to the client.
  4. The client sends the token to Doverunner to request a DRM license.
  5. Doverunner issues the license.

The token carries the usage rules for that request: the encryption and usage conditions that decide what the viewer may do with the content, such as how it can be played. Doverunner applies them when it issues the license.

Two ways to generate a token

In a real integration, your service site generates the token on its own server, using the license token sample code Doverunner provides in Java, Python, and PHP. The token has to be generated there so that it's issued only after you have checked that the user is allowed to watch. Your site key and access key stay on the server and never reach the browser.

To keep this quickstart short, you'll create a test token in Doverunner Lab instead of writing server code.

1. Find your site credentials

You need three values from Doverunner Console: Site ID, Site Key, and Access Key. Log in to Doverunner Console, go to Content Security > Multi DRM > Settings, and select Retrieve Secret Information to reveal them. This is the same screen that showed the KMS token in the packaging lesson.

Doverunner Lab doesn't issue these values and needs no login, so get them from Console first. The Lab computes the token in your browser and doesn't send your site key or access key anywhere.

2. Open the license token generator

In Doverunner Lab, go to Playground > DRM Tools > License policy & token tools and scroll to the License token generator. Fill in the form:

Field What to enter
Site ID, Site key, Access key The three values from Console
DRM type The DRM your test browser supports. Widevine for Chrome and Firefox, PlayReady for Edge, FairPlay for Safari
Content ID (CID) The content ID you passed to --content_id when packaging
User ID Any identifier for the viewer. The default lab-guest is fine (max 200 alphanumeric characters)
Timestamp (GMT) Already set to the current time. Select Now to refresh it if you come back later
Response format original for this course
Key rotation false for this course. It applies to live streams
License policy JSON The default {"policy_version":2} is a simple test policy. Leave it as is

The page also has a License policy generator above the form, which builds the policy JSON for you, and a License token validator below it. You don't need the policy generator for this lesson.

3. Generate the token

Select Generate token. The Result box shows your token as a Base64 string. Copy it and keep it handy for the next lesson.

How long the token is valid

By default a token is valid for 600 seconds (10 minutes) from its timestamp. That's long enough to test a license request, but if you take a break, select Now and generate a new one. You can change the validity period in Doverunner Console under Site Settings > Integration Settings.

Token validity is the window in which a license can be issued with this token. How long the content can be played after the license is issued is a separate setting, the license validity.

To check a token's timestamp, DRM type, and content ID before you use it, paste it into the license token validator with your site key.

What's next

In the next lesson, play your content in the Lab's DRM playback tester with the token you just made. To learn how real integrations generate tokens and what a token can contain, see the License Token guide.