Nonstop Brightscript SDK
Playing Content Nonstop
In order to play content Nonstop the client app should pass additional values to the EIA Entitlement and EIA Ads services.
There is one additional parameter:
- cbp_token - An encrypted JWT Access token to pass through to EIA Services
Access Tokens (cbp_token)
EIA Services require an Access Token to be sent to validate requests to stream with the reduced ad load. Access Tokens will be provided on call-backs or results from SDK methods that can instruct the client to play Nonstop.
These are:
The Access Token is generated Server Side using the following approach:
- The backend runs through all of the validation and business logic to determine that the requested Content is indeed available for the user to watch Nonstop this includes:
- Does the user exist?
- Does the content exist?
- Is this content available to watch Nonstop?
- Is the number of points the user is trying to use for the content correct?
- Does the user have enough points to use to watch this Nonstop?
- Has the user previously purchased this content?
- Is the purchase within the grace period?
- If an Access Token is required the Nonstop server gets a Secret from Azure Key Vault and uses it to create an X509Certificate
- A Security Token Descriptor is created containing two claims
- The Users External ID as the Name claim
- A "cbp" claim with a value of 1
- The expiry on the token is set to 60 seconds from creation
- The issuer is set as "nonstop"
- The token descriptors SigningCredentials are set to use the X509Certificate to create an X509SecurityKey with an RsaSha256Signature
- This is converted into a JWT Security Token
- This is converted to a string
- This is returned to the Client SDK along with the instruction to play Nonstop
- The Client app should send the token to the player framework using the "cbp_token" parameter
- These services can decrypt the Access Token using the reverse of the process above
- Once decrypted, the Expires data should be tested for recency. All signed requests should be received within 60 seconds.
- Once decrypted, the cbp claim should be tested for a value of 1
- If the request does not validate the service can either drop back to a standard Ad load or return an error