Package version:

Class InteractiveBrowserCredential

Enables authentication to Microsoft Entra ID inside of the web browser using the interactive login flow.

Implements

Constructors

Methods

Constructors

Methods

  • Authenticates with Microsoft Entra ID and returns an access token if successful. If authentication fails, a CredentialUnavailableError will be thrown with the details of the failure.

    If the token can't be retrieved silently, this method will always generate a challenge for the user.

    On Node.js, this credential has Proof Key for Code Exchange (PKCE) enabled by default. PKCE is a security feature that mitigates authentication code interception attacks.

    Parameters

    • scopes: string | {}

      The list of scopes for which the token will have access.

    • options: GetTokenOptions = {}

      The options used to configure any requests this TokenCredential implementation might make.

    Returns Promise<undefined | AuthenticationRecord>

  • Authenticates with Microsoft Entra ID and returns an access token if successful. If authentication fails, a CredentialUnavailableError will be thrown with the details of the failure.

    If the user provided the option disableAutomaticAuthentication, once the token can't be retrieved silently, this method won't attempt to request user interaction to retrieve the token.

    Parameters

    • scopes: string | {}

      The list of scopes for which the token will have access.

    • options: GetTokenOptions = {}

      The options used to configure any requests this TokenCredential implementation might make.

    Returns Promise<AccessToken>