Labb - DX Accelerator
    Preparing search index...

    Class OAuth2Service

    Index

    Constructors

    Methods

    • Decodes the operator information stored in the JWT token.

      Parameters

      • token: string

        The OAuth2 access token as a base64 encoded string

      Returns any

      The claims inside the payload of the token as a JSON object. See e.g. standard claims for the standard claims of an openid token.

    • Acquires an access token using the OAuth2 authorization code flow.

      Parameters

      • config: OAuth2Config

        The OAuth2 configuration object containing the Infinity server URL, client ID, client secret and optionally the pkce flag, the appId and the authService.

      Returns Promise<TokenInfo>

      A Promise that resolves to a TokenInfo object containing the acquired access token.

    • Acquires an access token using the OAuth2 client credentials flow.

      Parameters

      • config: OAuth2Config

        The OAuth2 configuration object containing the Infinity server URL, client ID, client secret, username, and password.

      Returns Promise<TokenInfo>

      A Promise that resolves to a TokenInfo object containing the acquired access token.

    • Refreshes an access token using an existing refresh_token and the token endpoint

      Parameters

      • config: OAuth2Config

        The OAuth2 configuration object containting the clientId, accessTokenUrl and refreshToken

      Returns Promise<TokenInfo>

      A Promise that resolves to a TokenInfo object containing the refreshed access token.

    • Revokes an active access token

      Parameters

      • config: OAuth2Config

        The OAuth2 configuration object that was originally used for retrieving the access token

      • token: TokenInfo

      Returns Promise<void>

      A Promise that resolves when the token is revoked