Skip to main content

Create and sign a license service message

This article is a part of the DRM How-to Guides.

Before you can send an Entitlement Message to the License Service, you have to wrap it into a so called License Service Message and make a signed JWT token out of it.

License Service Message is a JSON data structure used as an envelope. Here is a minimalistic version (additionally, you can specify a time period of validity of the enclosed Entitlement Message):

Minimalistic License Service Message
{
"version": 1,
"com_key_id": "YOUR_COMMUNICATION_KEY_ID",
"message": {YOUR_ENTITLEMENT_MESSAGE}
}

Replace "YOUR_COMMUNICATION_KEY_ID" with the value from your DRM configuration, and {YOUR_ENTITLEMENT_MESSAGE} with the Entitlement Message JSON object you generated in the previous section. With the Mosaic DRM Service, find the Key ID under Admin Settings / DRM Service / Communication Key in the Management System; with a DRM configuration in Axinom Portal, check My Mosaic / DRM.

note

If you have a legacy agreement, your environment has no DRM Service page. You find the Key ID and the key value in the Axinom Portal and in your configuration PDF instead, as described in Legacy agreement credentials.

Caution

We highly recommend also setting a short expiration_date to limit unintended re-use of the tokens.

To create a JWT, use the License Service Message above as a payload and sign it with HMAC-SHA256 algorithm using your Communication Key as a signing key. Then apply base64 encoding.

The easiest way to do it: copy your JSON to the DRM Video Playback Tool under "License Service Message" and click the "License Service Message -> JWT" button (add your Communication Key and Communication Key ID to the corresponding fields).

To generate a JWT programmatically, check Signing a License Service Message article. It shows how to create and sign the JWT in many programming languages, including JavaScript, C#, PHP, Python, Rust, Go, C++, Swift, Scala, Java.

To send your JWT to Axinom DRM License Service use one of the methods described in License Service Message.

Next steps​

See also​

Was this page helpful?