Client responsible for establishing entitlements of federated identities.

Implements

Constructors

Methods

  • Record consumption of a set of boolean entitlements.

    This is to support services that want a record of usage recorded but have no service side enforcement point.

    Parameters

    • entitlementNames: string[]

      Boolean entitlement names to record consumption of

    Returns Promise<void>

    Throws

    NotSignedInError User is not signed in

    Throws

    InsufficientEntitlementsError User is not entitled to one or more of the boolean entitlements. Check entitlements and that redeemEntitlements has been called for the user.

    Throws

    InvalidArgumentError One or more of the specified entitlement names does not correspond to a boolean entitlement defined to the entitlements serivce

    Throws

    ServiceError An error occurred within the entitlements service that indiciates an issue with the configuration or operation of the service. *

  • Return any entitlements for the currently logged in user or null if none.

    This will return undefined for any of the conditions that return Sudos for the redeemEntitlements API.

    Returns Promise<undefined | EntitlementsSet>

    Currently active entitlements set as an [[EntitlementsSet]], if any, for the logged in user.

  • Return entitlements consumption information for the user.

    Returns Promise<EntitlementsConsumption>

    [[EntitlementsConsumption]]: Current entitlements and consumption for the logged in user.

    Throws

    NoEntitlementsError

    • Identity token has not been redeemed.

    Throws

    InvalidTokenError

    • Identity token contains no FSSO user identity information
    • Identity token contains no claims recognized as entitling the user
    • Identity token claims that are recognized specify unrecognized entitlements sets
  • Retrieve external ID for the user.

    Returns Promise<string>

    [[string]]: The user's external ID.

    Throws

    InvalidTokenError

    • Identity token contains no claims recognized as identifying the external user.
  • Redeem entitlements for the currently logged in user.

    If the user has already redeemed entitlements then the user's current entitlements as determined by the original redemption and any subsequent administrative modifications rather than entitlements corresponding to the user's current identity token claims are returned.

    Returns Promise<EntitlementsSet>

    Redeemed or currently active entitlements set for the logged in user.

    Throws

    InvalidTokenError

    • Identity token contains no FSSO user identity information
    • Identity token contains no claims recognized as entitling the user
    • Identity token claims that are recognized specify unrecognized entitlements sets

    Throws

    ServiceError

    • An error occurred within the entitlements service that indicates an issue with the configuration or operation of the service.

    Throws

    AmbiguousEntitlementsError

    • Multiple identity token claims are recognized and specify conflicting entitlement sets