Activating a TVkey device with SSO
Request
To activate a TVkey device with using SSO, send a POST request to:
https://<host>:<port>/ags/register/{type}
Headers
x-correlation-id
– identifier for logging, to correlate messages across a call flowx-auth-service-id
– the ID of the authentication (SSO) service to be used for authentication (mandatory)nv-tenant-id
– the tenant ID
Mandatory arguments
– the registration type (in URL). The valid options fortype
type
are defined in the response to theGET /servicediscovery
request.x-auth-service-id
– (in header) – see aboveparameters
– an array of parameters. These are defined in the response to theGET /servicediscovery
request.
Each member of the array is a key/value pair in the following form:CODE{ "parameters": [ { "name": "<name>", "value": "<value>" } ] }
Other arguments
None
Example
A POST request with this payload registers the TVkey device:
{
"parameters": [
{
"name": "username",
"value": "dave"
}
]
}
Note that the contents of the parameters
block depend on the requirements of the SSO provider.
Response
A successful request returns either an HTTP 201 or 300 status:
- 201 means that the request was successful. The response includes the access and refresh tokens.
- 300 means that more than one matching account was found in OpenTV Video Platform. The application must prompt the user to select the account they want to use and then call
POST /subsequentRegister
to actually sign on with this account.
A bad request returns an HTTP 400 status.
An unauthorised request returns an HTTP 401 status.
A forbidden request returns an HTTP 403 status.
Example
The body of the response to a request that returns a 201 status is empty.
The body of the response to a request that returns a 300 status looks like this:
{
"accounts": [
{
"accountInformation": "{\"apellido\":\"London bride is falling down\",\"cuenta\":\"1660\",\"direccion\":null,\"estado\":null,\"nombre\":\"My fair lady.\",\"numeroIdentificacion\":null,\"telAdicional\":null,\"telCasa\":null,\"telOficina\":null,\"tipoIdentificacion\":null,\"tipoSuscriptor\":null,\"avisoFinal\":null,\"fechaDX\":null,\"saldo\":null,\"segundoApellido\":null}",
"userAccountToken": "eyJraWQiOiIyNTk2MjkiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50SWQiOiIxNjYwIiwiY2xpZW50SWQiOiJQVUJfOTg4IiwidHlwIjoiU2lnbk9uRGV0YWlscyIsImlzcyI6Im1vY2siLCJleHAiOjE2NTQ4Njg4Nzd9.OtAJXFskKOyY2p7ric87fyXLLpLZ3GrvaYvEB_kx73M"
},
{
"accountInformation": "{\"apellido\":\"Winky\",\"cuenta\":\"1661\",\"direccion\":\"Address123\",\"estado\":\"Condition 123\",\"nombre\":\"Teletubbies\",\"numeroIdentificacion\":\"Identification number 123\",\"telAdicional\":\"AdditionalPhone 987654321\",\"telCasa\":\"PhoneHome 88649987\",\"telOficina\":\"Office Tel 123456789\",\"tipoIdentificacion\":\"IdentificationType passport\",\"tipoSuscriptor\":\"Subscriber Type Monthly\",\"avisoFinal\":\"FinalNotice123\",\"fechaDX\":\"Date DX 123\",\"saldo\":\"Balance123\",\"segundoApellido\":\"Second Surname\"}",
"userAccountToken": "eyJraWQiOiIyNTk2MjkiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50SWQiOiIxNjYxIiwiY2xpZW50SWQiOiJQVUJfOTg4IiwidHlwIjoiU2lnbk9uRGV0YWlscyIsImlzcyI6Im1vY2siLCJleHAiOjE2NTQ4Njg4Nzd9.7ghTakgoDlwb7ySxzS5SZ-krtDtcNVv6xwKfw1IPVTc"
}
]
}
See also
For full details of this API, see the Authentication Gateway Service (AGS) API documentation.