Entitlement Service
Manage content entitlements and rights of end-users.
Overview
The purpose of an Entitlement Service is to decide based on the defined business rules if a given end-user should be able to play a given video and to provide respective entitlements.
Entitlement: the fact of having a right to something
A frontend application can then display or hide a video from the end-user. If DRM is used, it can further exchange the provided entitlements into a DRM license using a DRM License Service. This DRM License will be used by a video player (and the underlying Content Decryption Module) to decrypt and play the video.
Entitlement Service natively supports Axinom DRM (it generates an entitlement message directly understood by the Axinom DRM License Service), but it can easily be adjusted to communicate with other DRM providers, see DRM Support below.
Axinom Entitlement Service is a customizable service. It is provided in source code under an open-source license. You can use the service as-is, or you can freely customize it to tailor your environment.
Entitlement service is delivered as a part of the Mosaic Media Template.
Data Model
Entitlement Service owns the following data:
- GeoIP Database - for deriving end-user’s country based on the IP address.
GeoIP Database
A GeoIP Database is used for deriving end-user’s country based on the IP address. A free tier of a Maxmind country database is currently included.
The GeoIP Database is updated automatically on every Entitlement Service startup and then every 24 hours. This complies with the licensing conditions of Maxmind. The database can also be easily updated manually by updating geoip-country npm package that is used, since the vendor regularly deploys new versions with updated databases.
GUI
Entitlement Service does not have its own GUI.
Interfaces
GraphQL Frontend-facing
Entitlement Service exposes a GraphQL query endpoint entitlement()
that takes an entityId
as a parameter and returns (in positive case) an Entitlement Message and an array of claims that passed the evaluation.
entityId
is the ID of an entity that the caller would like to play, e.g. movie-123 or episode-456.
To call this endpoint, the end-user must be authenticated using the User Service and must provide a valid JWT token.
Business Rules
To make its decision the Entitlement Service performs the following steps:
Customizing Business Rules
If you would like to add/remove/modify the entitlement checks, you can easily do so by modifying the source code of the Entitlement Service.
Removing unused checks can make sense already from a performance point of view.
DRM Support
The service is compatible with Axinom DRM - it generates an Entitlement Message, that is understood natively by Axinom DRM License Service.
The currently implemented logic does the following:
- In a positive case, create an Axinom DRM Entitlement Message wrapped into an Axinom DRM License Service Message
- Include every Key ID (Key IDs are assumed to be maintained in the Video Service and published through the Catalog Service)
- Assign the same Policy to all Key IDs
- For this policy set for PlayReady - for development purpose - min_device_security_level: 150 and a PlayReady enabler "Support playback when the output type is unknown"
- Set license.allow_persistence to
true
orfalse
, depending on the presence of the claim ENABLE_VIDEOS_DOWNLOAD - Sign the generated Entitlement Message with the configured Communication Key (you can find it in your Axinom DRM configuration).
Customizing DRM Support
To customize the logic for Entitlement Message generation, adjust the file entitlement-message-generation.ts
.
If you use Axinom DRM, you may want to customize the structure of the Entitlement Message. See Entitlement Message (data structure) and Entitlement Message (Tool) for more details.
If you use a different DRM provider, replace the code according to the instructions of the respective provider.
Pricing
Entitlement Service is provided under an open-source license free of charge.