Skip to main content

PBS Account

PBS Account endpoints implement the new Public Media SSO API replacing the legacy PBS OAuth2 API.

On-device authentication

Perform on-device authentication with the following flow:

  1. POST /deviceInit
  2. Capture deviceId
  3. If necessary, POST /pbsAccount/register
  4. POST /pbsAccount/login (using deviceId from Step 1)
  5. Capture showVppaScreen and viewer.id

If showVppaScreen == true:

  1. Offer VPPA agreement to viewer (must be accepted, if declined return to login screen)
  2. On accept, PATCH /pbsAccount/profile (using viewer.id from initial flow Step 5)
  3. POST /deviceInit

POST /pbsAccount/register

Purpose

Register a new PBS Account user.

See Akamai - Complete traditional registration for details about the upstream API, but note that not all features are supported for PBS Account register.

Payload

Type

JSON in body.

Parameters
ParameterRequiredTypeDescription
emailAddressYesStringUser email address.
firstNameYesStringUser first name (1 - 25 characters).
lastNameYesStringUser last name (1 - 25 characters).
passwordYesStringAccount password (8 - 90 characters, at leastone letter and one number).
stationIdYesUUIDID of the station associated with the request.

Responses

Indicates the account was created.

POST /pbsAccount/login

The pbsAccount.login webhook is sent on successful login.

Purpose

Log in a PBS Account user.

See Akamai - Supported authorization grant types for details about the client_credentials grant flow used for login.

See Public Media SSO - POST /v2/login_resolve/ for details about the upstream login finalization for Public Media SSO.

Payload

Type

JSON in body.

Parameters
ParameterRequiredTypeDescription
deviceIdYesStringDevice ID for the user logging in.
passwordYesStringAccount password.
stationIdYesUUIDID of the station associated with the request.
usernameYesUUIDAccount username.

Responses

JSON body with:

  • showVppaScreen: Boolean indicator if the viewer requires a VPPA agreement and does not have one. When true, the FE must offer the VPPA agreement to the viewer before continuing.
  • viewer: Information about the logged in viewer:
  • id: Viewer ID.
  • pbsAccountId: Viewer PBS Account ID

PATCH /pbsAccount/profile

Purpose

Updates a PBS Account profile.

Currently, this endpoint only supports updating the VPPA accepted status of a profile.

See Public Media SSO - PATCH /v2/user/profile/ for details about the upstream API.

Payload

Type

JSON in body.

Parameters
ParameterRequiredTypeDescription
profileYesObjectProfile fields to update. Values keyed by profile field name.
vppa_acceptedNoBooleanWhether the viewer has accepted the VPPA agreement.
stationIdYesUUIDID of the station associated with the request.
viewerIdYesUUIDViewer ID to update the associated PBS Account profile for.

Responses

Indicates the profile was updated.

POST /pbsAccount/forgotPassword

Purpose

Initiates a forgot password flow for a PBS Account.

See Akamai - Send a reset password link for details about the upstream API, but note that not all features are supported for PBS Account forgot password flow.

Payload

Type

JSON in body.

Parameters
ParameterRequiredTypeDescription
emailAddressYesStringEmail address associated with the PBS Account.
stationIdYesUUIDID of the station associated with the request.

Responses

Indicates the forgot password flow was initiated.

The user will recieve an email and continue the reset process in a web browser.

Public Media SSO authorization

POST /pbsAccount/sso/init

Purpose

Starts the OAuth2 authorization flow for a PBS Account for frontends using a custom OAuth2 PKCE flow.

Payload

Type

JSON in body.

Parameters
ParameterRequiredTypeDescription
deviceIdYesStringDevice ID for the user logging in.
resturnUriYesStringURI to return the user to from the SSO callback.
stationIdYesUUIDID of the station associated with the request.

Responses

JSON body with OAuth2 client configuration values:

  • authorizationEndpoint: Authorization endpoint URL.
  • clientId: Public client ID.
  • codeChallenge: Code challenge value.
  • codeChallengeMethod: Code challenge method.
  • redirectUri: Callback URI.
  • scopes: Scopes to request.
  • state: Random state value.

GET /pbsAccount/sso/login

The pbsAccount.ssoLogin webhook is sent on successful SSO authorization (during callback processing).

Purpose

Starts the OAuth2 authorization flow for a PBS Account for frontends using device-code based authorization.

See Public Media SSO - POST /v2/login_resolve/ for details about the upstream login finalization for Public Media SSO.

Payload

Type

Search parameters.

Parameters
ParameterRequiredTypeDescription
providerYesStringAuthorization provider.
stateYesStringOAuth2 state value.

Responses

Redirect to the requested authorization provider.