Generating license tokens in Doverunner Lab
Shows how to generate and inspect DRM license tokens in the Doverunner Lab Playground, no login required.
Transcript
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:
- Understand how the token flow works
- Find your site ID, site key, and access key
- 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:
- The player requests playback from your service.
- Your service site generates a license token.
- The token is delivered to the client.
- The client sends the token to Doverunner to request a DRM license.
- 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.