Options
All
  • Public
  • Public/Protected
  • All
Menu

Class InteractiveBrowserCredential

Package version

Enables authentication to Azure Active Directory inside of the web browser using the interactive login flow. Enables authentication to Azure Active Directory inside of the web browser using the interactive login flow.

This credential uses the Authorization Code Flow. On NodeJS, it will open a browser window while it listens for a redirect response from the authentication service. On browsers, it authenticates via popups. The loginStyle optional parameter can be set to redirect to authenticate by redirecting the user to an Azure secure login page, which then will redirect the user back to the web application where the authentication started.

It's recommended that the AAD Applications used are configured to authenticate using Single Page Applications. More information here: link.

This credential uses the Authorization Code Flow. On NodeJS, it will open a browser window while it listens for a redirect response from the authentication service. On browsers, it authenticates via popups. The loginStyle optional parameter can be set to redirect to authenticate by redirecting the user to an Azure secure login page, which then will redirect the user back to the web application where the authentication started.

It's recommended that the AAD Applications used are configured to authenticate using Single Page Applications. More information here: link.

Hierarchy

  • InteractiveBrowserCredential

Implements

  • any
  • any

Index

Constructors

Methods

Constructors

constructor

Methods

authenticate

  • authenticate(scopes: string | string[], options?: GetTokenOptions): Promise<AuthenticationRecord | undefined>
  • Authenticates with Azure Active Directory and returns an access token if successful. If authentication cannot be performed at this time, this method may return null. If an error occurs during authentication, an AuthenticationError containing failure details will be thrown.

    If the token can't be retrieved silently, this method will require user interaction to retrieve the token.

    Parameters

    • scopes: string | string[]

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

    • Default value options: GetTokenOptions = {}

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

    Returns Promise<AuthenticationRecord | undefined>

getToken

  • getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>
  • Authenticates with Azure Active Directory and returns an access token if successful. If authentication cannot be performed at this time, this method may return null. If an error occurs during authentication, an AuthenticationError containing failure details will be thrown.

    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 | string[]

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

    • Default value options: GetTokenOptions = {}

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

    Returns Promise<AccessToken>

Generated using TypeDoc