Generating license tokens in Dev Console
Shows how to generate and inspect DRM license tokens using DoveRunner Dev Console, no login required.
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 Dev Console
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 Dev Console 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.
Dev Console doesn't issue these values and needs no login, so get them from Console first.
2. Open the License Token Generator
Go to Dev Console at devconsole.doverunner.com, then open DRM Tools > License Token Generator (direct link). 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. It's case-sensitive |
| CID | The content ID you passed to --content_id when packaging |
| USER ID | Any identifier for the viewer, such as test-user (max 200 alphanumeric characters) |
| Time stamp | Leave blank to use the current time |
| 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 them 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 time stamp. That's long enough to test a license request, but if you take a break, 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.
What's next
In the next lesson, play your content in Dev Console's player with the token you just made. To learn how real integrations generate tokens and what a token can contain, see the License Token guide.