Class UserManager

Provides a higher level API for signing a user in, signing out, managing the user's claims returned from the identity provider, and managing an access token returned from the identity provider (OAuth2/OIDC).

Constructors

Properties

Get the settings used to configure the UserManager.

Accessors

Methods

  • Removes stale state entries in storage for incomplete authorize requests.

    Returns Promise<void>

  • Dynamically generates a DPoP proof for a given user, URL and optional Http method. This method is useful when you need to make a request to a resource server with fetch or similar, and you need to include a DPoP proof in a DPoP header.

    Parameters

    • url: string

      The URL to generate the DPoP proof for

    • user: User

      The user to generate the DPoP proof for

    • OptionalhttpMethod: string

      Optional, defaults to "GET"

    • Optionalnonce: string

      Optional nonce provided by the resource server

    Returns Promise<undefined | string>

    A promise containing the DPoP proof or undefined if DPoP is not enabled/no user is found.

  • Parameters

    • dpopSettings: DPoPSettings

    Returns Promise<undefined | string>

  • Load the User object for the currently authenticated user.

    Returns Promise<null | User>

    A promise

  • Remove from any storage the currently authenticated user.

    Returns Promise<void>

    A promise

  • Parameters

    • Optionaltypes: ("access_token" | "refresh_token")[]

    Returns Promise<void>

  • Trigger a request (via a popup window) to the authorization endpoint.

    Parameters

    Returns Promise<User>

    A promise containing the authenticated User.

    Error In cases of wrong authentication.

  • Trigger a redirect of the current window to the authorization endpoint.

    Parameters

    Returns Promise<void>

    A promise

    Error In cases of wrong authentication.

  • Trigger a silent request (via refresh token or an iframe) to the authorization endpoint.

    Parameters

    Returns Promise<null | User>

    A promise that contains the authenticated User.

  • Trigger a redirect of a popup window to the end session endpoint.

    Parameters

    Returns Promise<void>

    A promise

  • Trigger a redirect of the current window to the end session endpoint.

    Parameters

    Returns Promise<void>

    A promise

  • Trigger a silent request (via an iframe) to the end session endpoint.

    Parameters

    Returns Promise<void>

    A promise

  • Enables silent renew for the UserManager.

    Returns void

  • Disables silent renew for the UserManager.

    Returns void