OpenTV ENTera & OpenTV Platform Documentation
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2

Enabling single sign-on to a self-care portal

Overview

OpenTV Platform can sign users in to a third-party web application automatically, so that they don’t have to sign in again – for example, when they open the operator’s self-care portal from the client application.

It does this with identity tokens. An identity token is a short-lived token, signed by OpenTV Platform, that identifies the user’s account and device. The web application’s back end checks the token’s signature with a public key that it gets from OpenTV Platform, so it doesn’t need to call OpenTV Platform for each user, and it never sees the client’s access token.

How it works

  1. The web application’s back end gets the public keys from OpenTV Platform, using a Keycloak access token – see Getting the identity token public keys. It can keep the keys and get them again when it needs to.

  2. The user signs in to the client application as usual.

  3. When the user opens the web application, the client application requests an identity token with its access token – see Getting an identity token in the Client integration guide.

  4. The client application opens the web application and passes it the identity token – for example, as a query parameter in the URL or in a request header. How the token is passed is agreed between the client application and the web application. For OpenTV ION, see the Self-care portal integration guide in the OpenTV ION documentation.

  5. The web application’s back end validates the token and reads the account and device IDs from it – see Validating an identity token.

  6. If it needs more information about the account, the back end can use the operator APIs – see Managing accounts.

What an identity token contains

An identity token is a JWT signed with RS256. Its header contains:

  • alg – always RS256

  • kid – the ID of the key that signed the token

Its payload contains the following claims:

  • sub – the account ID (the same as accountId)

  • accountId – the ID of the account (its _id in the Account and Device Manager)

  • tenantId – the tenant that the account belongs to

  • deviceId – the public ID of the device that requested the token (its publicId in the Account and Device Manager)

  • iss – the issuer, always IAS

  • iat – when the token was issued, in seconds since the Unix epoch

  • exp – when the token expires, in seconds since the Unix epoch

For example:

JSON
{
  "sub": "6af1db24231b3dcc8826537b",
  "accountId": "6af1db24231b3dcc8826537b",
  "tenantId": "nagra",
  "deviceId": "3c5e7a9b-1d2f-4a6b-8c0e-2f4a6c8e0b1d",
  "iss": "IAS",
  "iat": 1794501738,
  "exp": 1794502038
}

An identity token is valid for a short time (by default, five minutes, but this can vary by deployment). It can’t be refreshed – the client application requests a new one.

An identity token has no aud (audience) claim, so it isn’t tied to a particular web application. Only send it over HTTPS, and don’t log it.

Signing keys

OpenTV Platform signs identity tokens with an RSA key pair. The private key never leaves OpenTV Platform, and the public keys are available from an operator API. A deployment uses the same keys for all its tenants.

The keys can be changed (rotated). When this happens, a new key becomes the current key, and the previous key stays in the list of public keys until the tokens that it signed have expired.

Identity tokens are set up for each deployment. If they haven’t been set up, the identity token APIs return an HTTP 500 status ("errorCode": 8001). To use this feature, contact your NAGRAVISION representative.

Supported actions

See also