Skip to main content
Skip table of contents

Getting an access token

Request

A CRM needs an access token to make requests to OpenTV Video Platform.

To get an access token, send a POST request to:

CODE
https://<host>:<port>/keycloak/auth/realms/nagra/protocol/openid-connect/token

Headers

  • Content-Type – application/x-www-form-urlencoded 

Mandatory arguments

  • grant_type – always password

  • username – username of a user with the operatorRole role

  • password – password of the user

  • client_id – the client ID as defined by NAGRAVISION

Other arguments

None

Example

This is an example of the request body:

CODE
grant_type:password
username:crm_client_user
password:1234
client_id:crm_client

Response

The response body includes the access and refresh tokens. Their validity periods are as follows:

  • Access token: five minutes

  • Refresh token: 30 minutes

These are the default validity times.

Example

CODE
{
    "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ3aGVOd25SZWMyVF81RFVLcFlCNll5VUgtOEpIb0IxUHVvb1J4VHV6QzUwIn0.eyJqdGkiOiI4NGEyYmE1OS02YmViLTQ4OWQtOGNkNi0zZWFmMzRkNDZiNGQiLCJleHAiOjE1Nzc5NzYyMjMsIm5iZiI6MCwiaWF0IjoxNTc3OTc1OTIzLCJpc3MiOiJodHRwczovL29wZXJhdG9yLnNhbGVzLm90dnNlLmNvbS9rZXljbG9hay9hdXRoL3JlYWxtcy9uYWdyYSIsInN1YiI6IjE3NGJjMWZiLTE4MmMtNDY5MS1iNzhhLTJiZGNjZjBjN2M2NyIsInR5cCI6IkJlYXJlciIsImF6cCI6Im1hcnRpbl9jbGllbnQiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiI0YTZkZTc4YS1mNTYyLTRiNmEtYTk3Yi03YTdjYTE1NGZhY2YiLCJhY3IiOiIxIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9wZXJhdG9yUm9sZSJdfSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJtYXJ0aW4ifQ.s5luO7xZi9Qd8YJ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l6b4dJSB7hdnoa9NpJyyczt0ZXFavWT6pO0ERtYW1uE",
    "token_type": "bearer",
    "not-before-policy": 0,
    "session_state": "4a6de78a-f562-4b6a-a97b-7a7ca154facf",
    "scope": "profile email"
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.