Entitlement Flows

A. Prerequisites

  1. Create your callback functions:

    • setRequestorComplete()

      Triggered by setRequestor(), returns success or failure.
      Success indicates you can proceed with entitlement calls.

    • displayProviderDialog(mvpds)

      Triggered by getAuthentication() only if the user has not selected a provider (MVPD) and is not yet authenticated.
      The mvpds parameter is an array of providers available to the user.

    • setAuthenticationStatus(status, errorcode)

      Triggered by checkAuthentication() every time.
      Triggered by getAuthentication() only if the user is already authenticated and has selected a provider.

      Status returned is success or failure, the errorcode describes the type of the failure.

    • navigateToUrl(url)

      Triggered by getAuthentication() after the user selects an MVPD. The url parameter provides the location of the MVPD’s login page.

    • sendTrackingData(event, data)

      Triggered by checkAuthentication(), getAuthentication(), checkAuthorization(), getAuthorization(), setSelectedProvider().
      The event parameter indicates which entitlement event occurred; the data parameter is a list of values relating to the event.

    • setToken(token, resource)

      Triggered by checkAuthorization() and getAuthorization() after a successful authorization to view a resource.
      The token parameter is the short-lived media token; the resource parameter is the content that the user is authorized to view.

    • tokenRequestFailed(resource, code, description)

      Triggered by checkAuthorization() and getAuthorization() after an unsuccessful authorization.
      The resource parameter is the content that the user was attempting to view; the code parameter is the error code indicating what type of failure occurred; the description parameter describes the error associated with the error code.

    • selectedProvider(mvpd)

      Triggered by getSelectedProvider().
      The mvpd parameter provides information about the provider selected by the user.

    • setMetadataStatus(metadata, key, arguments)

      Triggered by getMetadata().
      The metadata parameter provides the specific data you requested; the key parameter is the key used in the getMetadata() request; and the arguments parameter is the same dictionary that was passed to getMetadata().

    • preauthorizedResources(resources)

      Triggered by checkPreauthorizedResources().
      The authorizedResources parameter presents the resources that the user is authorized to view.