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.

    Parameters

    • raiseEvent: boolean = false

      If true, the UserLoaded event will be raised. Defaults to false.

    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.

  • Notify the opening window of response (callback) from the authorization endpoint. It is recommended to use UserManager.signinCallback instead.

    Parameters

    • url: string = window.location.href
    • keepOpen: boolean = false

    Returns Promise<void>

    A promise

  • Enables silent renew for the UserManager.

    Returns void

  • Disables silent renew for the UserManager.

    Returns void