@azure/msal-browser package
Classes
| AuthError |
General error class thrown by the MSAL.js library. |
| AuthenticationHeaderParser |
This is a helper class that parses supported HTTP response authentication headers to extract and return header challenge values that can be used outside the basic authorization flows. |
| BrowserAuthError |
Browser library error class thrown by the MSAL.js library for SPAs |
| BrowserConfigurationAuthError |
Browser library error class thrown by the MSAL.js library for SPAs |
| BrowserPerformanceClient | |
| BrowserPerformanceMeasurement | |
| ClientAuthError |
Error thrown when there is an error in the client code running on the browser. |
| ClientConfigurationError |
Error thrown when there is an error in configuration of the MSAL.js library. |
| EventHandler | |
| EventMessageUtils | |
| InteractionRequiredAuthError |
Error thrown when user interaction is required. |
| LocalStorage | |
| Logger |
Class which facilitates logging of messages to a specific place. |
| MemoryStorage | |
| NavigationClient | |
| PublicClientApplication |
The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification. |
| ServerError |
Error thrown when there is an error with the server code, for example, unavailability. |
| SessionStorage | |
| SignedHttpRequest | |
| StubPerformanceClient | |
| AuthFlowActionRequiredStateBase |
Base class for the action requried state in an authentication flow. |
| AuthFlowStateBase |
Base class for the state of an authentication flow. |
| AuthMethodRegistrationChallengeMethodError |
Error that occurred during authentication method challenge request. |
| AuthMethodRegistrationChallengeMethodResult |
Result of challenging an authentication method for registration. Uses base state type to avoid circular dependencies. |
| AuthMethodRegistrationCompletedState |
State indicating that the auth method registration flow has completed successfully. |
| AuthMethodRegistrationFailedState |
State indicating that the auth method registration flow has failed. |
| AuthMethodRegistrationRequiredState |
State indicating that authentication method registration is required. |
| AuthMethodRegistrationSubmitChallengeError |
Error that occurred during authentication method challenge submission. |
| AuthMethodRegistrationSubmitChallengeResult |
Result of submitting a challenge for authentication method registration. |
| AuthMethodVerificationRequiredState |
State indicating that verification is required for the challenged authentication method. |
| CustomAuthAccountData | |
| CustomAuthApiError |
Custom Auth API error. |
| CustomAuthError | |
| CustomAuthPublicClientApplication | |
| GetAccessTokenResult | |
| GetAccountError |
The error class for get account errors. |
| GetAccountResult | |
| GetCurrentAccountAccessTokenError |
The error class for getting the current account access token errors. |
| HttpError | |
| InvalidArgumentError | |
| InvalidConfigurationError | |
| MethodNotImplementedError | |
| MfaAwaitingState |
State indicating that MFA is required and awaiting user action. This state allows the developer to pause execution before sending the code to the user's email. |
| MfaCompletedState |
State indicating that the MFA flow has completed successfully. |
| MfaFailedState |
State indicating that the MFA flow has failed. |
| MfaRequestChallengeError |
Error that occurred during MFA challenge request. |
| MfaRequestChallengeResult |
Result of requesting an MFA challenge. Uses base state type to avoid circular dependencies. |
| MfaSubmitChallengeError |
Error that occurred during MFA challenge submission. |
| MfaSubmitChallengeResult |
Result of submitting an MFA challenge. |
| MfaVerificationRequiredState |
State indicating that MFA verification is required. The challenge has been sent and the user needs to provide the code. |
| MsalCustomAuthError | |
| NoCachedAccountFoundError | |
| ParsedUrlError | |
| ResetPasswordCodeRequiredState |
Base class for the action requried state in an authentication flow. |
| ResetPasswordCompletedState |
Represents the state that indicates the successful completion of a password reset operation. |
| ResetPasswordError | |
| ResetPasswordFailedState |
State of a reset password operation that has failed. |
| ResetPasswordPasswordRequiredState |
Base class for the action requried state in an authentication flow. |
| ResetPasswordResendCodeError | |
| ResetPasswordResendCodeResult | |
| ResetPasswordStartResult | |
| ResetPasswordState |
Base class for the action requried state in an authentication flow. |
| ResetPasswordSubmitCodeError | |
| ResetPasswordSubmitCodeResult | |
| ResetPasswordSubmitPasswordError | |
| ResetPasswordSubmitPasswordResult | |
| SignInCodeRequiredState |
Base class for the action requried state in an authentication flow. |
| SignInCompletedState |
Represents the completed state of the sign-in operation. This state indicates that the sign-in process has finished successfully. |
| SignInContinuationState |
Base class for the action requried state in an authentication flow. |
| SignInError | |
| SignInFailedState |
Represents the state of a sign-in operation that has been failed. |
| SignInPasswordRequiredState |
Base class for the action requried state in an authentication flow. |
| SignInResendCodeError | |
| SignInResendCodeResult | |
| SignInResult | |
| SignInState |
Base class for the action requried state in an authentication flow. |
| SignInSubmitCodeError | |
| SignInSubmitCodeResult | |
| SignInSubmitPasswordError | |
| SignInSubmitPasswordResult | |
| SignOutError |
The error class for sign-out errors. |
| SignOutResult | |
| SignUpAttributesRequiredState |
Base class for the action requried state in an authentication flow. |
| SignUpCodeRequiredState |
Base class for the action requried state in an authentication flow. |
| SignUpCompletedState |
Represents the state of a sign-up operation that has been completed successfully. |
| SignUpError | |
| SignUpFailedState |
Represents the state of a sign-up operation that has failed. |
| SignUpPasswordRequiredState |
Base class for the action requried state in an authentication flow. |
| SignUpResendCodeError | |
| SignUpResendCodeResult | |
| SignUpResult | |
| SignUpState |
Base class for the action requried state in an authentication flow. |
| SignUpSubmitAttributesError | |
| SignUpSubmitAttributesResult | |
| SignUpSubmitCodeError | |
| SignUpSubmitCodeResult | |
| SignUpSubmitPasswordError | |
| SignUpSubmitPasswordResult | |
| UnexpectedError | |
| UnsupportedEnvironmentError | |
| UserAccountAttributeError | |
| UserAlreadySignedInError | |
Interfaces
| ILoggerCallback | |
| INavigationClient | |
| INetworkModule |
Client network interface to send backend requests. |
| IPerformanceClient | |
| IPublicClientApplication | |
| IWindowStorage | |
| AuthMethodDetails |
Details for an authentication method to be registered. |
| AuthenticationMethod | |
| ICustomAuthPublicClientApplication | |
Type Aliases
| AccountInfo |
Account object with the following signature:
|
| AuthenticationResult | |
| AuthorizationCodeRequest |
AuthorizationCodeRequest: Request object passed by browser clients to exchange an authorization code for tokens. |
| AzureCloudOptions |
AzureCloudInstance specific options
|
| BrokerConnectionEvent |
Payload for the BrokerConnectionEstablished event |
| BrowserAuthOptions |
Use this to configure the auth options in the Configuration object |
| BrowserSystemOptions | |
| BrowserTelemetryOptions |
Telemetry Options |
| CacheOptions |
Use this to configure the below cache configuration options: |
| ClearCacheRequest |
ClearCacheRequest |
| Configuration |
This object allows you to configure important elements of MSAL functionality and is passed into the constructor of PublicClientApplication |
| EndSessionPopupRequest |
EndSessionPopupRequest |
| EndSessionRequest |
EndSessionRequest |
| EventCallbackFunction | |
| EventError | |
| EventMessage | |
| EventPayload | |
| ExternalTokenResponse |
Response object used for loading external tokens to cache.
|
| HandleRedirectPromiseOptions | |
| IController | |
| IdTokenClaims |
Type which describes Id Token claims known by MSAL. |
| InProgressPerformanceEvent | |
| InitializeApplicationRequest |
InitializeApplicationRequest: Request object passed by user to initialize application |
| LoadTokenOptions | |
| NavigationOptions |
Additional information passed to the navigateInternal and navigateExternal functions |
| NetworkRequestOptions |
Options allowed by network request APIs. |
| NetworkResponse | |
| PerformanceCallbackFunction | |
| PerformanceEvent |
Performance measurement taken by the library, including metadata about the request and application. |
| PopupEvent | |
| PopupPosition | |
| PopupRequest |
PopupRequest: Request object passed by user to retrieve a Code from the server (first leg of authorization code grant flow) with a popup window. |
| PopupSize | |
| PopupWindowAttributes |
Popup configurations for setting dimensions and position of popup window |
| RedirectRequest |
RedirectRequest: Request object passed by user to retrieve a Code from the server (first leg of authorization code grant flow) with a full page redirect. |
| SignedHttpRequestOptions | |
| SilentRequest |
SilentRequest: Request object passed by user to retrieve tokens from the cache, renew an expired token with a refresh token, or retrieve a code (first leg of authorization code grant flow) in a hidden iframe. |
| SsoSilentRequest |
Request object passed by user to ssoSilent to retrieve a Code from the server (first leg of authorization code grant flow) |
| TenantProfile |
Account details that vary across tenants for the same user |
| AccessTokenRetrievalInputs | |
| AccountRetrievalInputs | |
| AuthMethodRegistrationChallengeMethodResultState |
Type definition for possible states in AuthMethodRegistrationChallengeMethodResult. |
| AuthMethodRegistrationSubmitChallengeResultState |
Type definition for possible states in AuthMethodRegistrationSubmitChallengeResult. |
| CustomAuthConfiguration | |
| GetAccessTokenResultState |
The possible states for the GetAccessTokenResult. This includes:
|
| GetAccountResultState |
The possible states for the GetAccountResult. This includes:
|
| MfaRequestChallengeResultState |
The possible states for the MfaRequestChallengeResult. This includes:
|
| MfaSubmitChallengeResultState | |
| ResetPasswordInputs | |
| ResetPasswordResendCodeResultState |
The possible states for the ResetPasswordResendCodeResult. This includes:
|
| ResetPasswordStartResultState |
The possible states for the ResetPasswordStartResult. This includes:
|
| ResetPasswordSubmitCodeResultState |
The possible states for the ResetPasswordSubmitCodeResult. This includes:
|
| ResetPasswordSubmitPasswordResultState |
The possible states for the ResetPasswordSubmitPasswordResult. This includes:
|
| SignInInputs | |
| SignInResendCodeResultState |
The possible states for the SignInResendCodeResult. This includes:
|
| SignInResultState |
The possible states for the SignInResult. This includes:
|
| SignInSubmitCodeResultState |
The possible states of the SignInSubmitCodeResult. This includes:
|
| SignInSubmitPasswordResultState |
The possible states of the SignInSubmitPasswordResult. This includes:
|
| SignInWithContinuationTokenInputs | |
| SignOutResultState |
The possible states for the SignOutResult. This includes:
|
| SignUpInputs | |
| SignUpResendCodeResultState |
The possible states for the SignUpResendCodeResult. This includes:
|
| SignUpResultState |
The possible states for the SignUpResult. This includes:
|
| SignUpSubmitAttributesResultState |
The possible states for the SignUpSubmitAttributesResult. This includes:
|
| SignUpSubmitCodeResultState |
The possible states for the SignUpSubmitCodeResult. This includes:
|
| SignUpSubmitPasswordResultState |
The possible states for the SignUpSubmitPasswordResult. This includes:
|
| UserAccountAttributes | |
Enums
| InteractionType | |
| LogLevel |
Log message level. |
Functions
| create |
creates NestedAppAuthController and passes it to the PublicClientApplication, falls back to StandardController if NestedAppAuthController is not available |
| create |
creates PublicClientApplication using StandardController |
| is |
Checks if the platform broker is available in the current environment. |
| load |
API to load tokens to msal-browser cache. |
| broadcast |
Processes the authentication response from the redirect URL For SSO and popup scenarios broadcasts it to the main frame For redirect scenario navigates to the home page |
Variables
| Api |
API Codes for Telemetry purposes. Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs 0-99 Silent Flow 800-899 Auth Code Flow 900-999 Misc |
| Authentication |
|
| Azure |
|
| Browser |
|
| Cache |
|
| Event |
|
| Interaction |
Types of interaction currently in progress. Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete. |
| Json |
|
| Protocol |
Protocol modes supported by MSAL. |
| Response |
|
| WrapperSKU | |
| DEFAULT_IFRAME_TIMEOUT_MS | |
| OIDC_DEFAULT_SCOPES | |
| Prompt |
|
| stubbed |
|
| version |
Function Details
createNestablePublicClientApplication(Configuration, string, (configuration: Configuration, controller: IPublicClientApplication) => IPublicClientApplication)
creates NestedAppAuthController and passes it to the PublicClientApplication, falls back to StandardController if NestedAppAuthController is not available
function createNestablePublicClientApplication(configuration: Configuration, correlationId?: string, pcaFactory?: (configuration: Configuration, controller: IPublicClientApplication) => IPublicClientApplication): Promise<IPublicClientApplication>
Parameters
- configuration
- Configuration
- correlationId
-
string
- pcaFactory
-
(configuration: Configuration, controller: IPublicClientApplication) => IPublicClientApplication
Returns
Promise<IPublicClientApplication>
IPublicClientApplication
createStandardPublicClientApplication(Configuration)
creates PublicClientApplication using StandardController
function createStandardPublicClientApplication(configuration: Configuration): Promise<IPublicClientApplication>
Parameters
- configuration
- Configuration
Returns
Promise<IPublicClientApplication>
IPublicClientApplication
isPlatformBrokerAvailable(LoggerOptions, IPerformanceClient, string)
Checks if the platform broker is available in the current environment.
function isPlatformBrokerAvailable(loggerOptions?: LoggerOptions, perfClient?: IPerformanceClient, correlationId?: string): Promise<boolean>
Parameters
- loggerOptions
- LoggerOptions
- perfClient
- IPerformanceClient
- correlationId
-
string
Returns
Promise<boolean>
loadExternalTokens(Configuration, SilentRequest, ExternalTokenResponse, LoadTokenOptions, IPerformanceClient)
API to load tokens to msal-browser cache.
function loadExternalTokens(config: Configuration, request: SilentRequest, response: ExternalTokenResponse, options: LoadTokenOptions, performanceClient?: IPerformanceClient): Promise<AuthenticationResult>
Parameters
- config
- Configuration
Object to configure the MSAL app.
- request
- SilentRequest
Silent request containing authority, scopes, and account.
- response
- ExternalTokenResponse
External token response to load into the cache.
- options
- LoadTokenOptions
Options controlling how tokens are loaded into the cache.
- performanceClient
- IPerformanceClient
Optional performance client used for telemetry measurements.
Returns
Promise<AuthenticationResult>
AuthenticationResult for the response that was loaded.
broadcastResponseToMainFrame(NavigationClient)
Processes the authentication response from the redirect URL For SSO and popup scenarios broadcasts it to the main frame For redirect scenario navigates to the home page
function broadcastResponseToMainFrame(navigationClient?: NavigationClient): Promise<void>
Parameters
- navigationClient
-
NavigationClient
Optional navigation client for redirect scenario.
Returns
Promise<void>
A promise that resolves when the response has been broadcast and cleanup is complete.
Variable Details
ApiId
API Codes for Telemetry purposes. Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs 0-99 Silent Flow 800-899 Auth Code Flow 900-999 Misc
ApiId: { acquireTokenByCode: 866, acquireTokenPopup: 862, acquireTokenRedirect: 861, acquireTokenSilent_authCode: 864, acquireTokenSilent_silentFlow: 61, handleRedirectPromise: 865, hydrateCache: 963, loadExternalTokens: 964, logout: 961, logoutPopup: 962, ssoSilent: 863 }
Type
{ acquireTokenByCode: 866, acquireTokenPopup: 862, acquireTokenRedirect: 861, acquireTokenSilent_authCode: 864, acquireTokenSilent_silentFlow: 61, handleRedirectPromise: 865, hydrateCache: 963, loadExternalTokens: 964, logout: 961, logoutPopup: 962, ssoSilent: 863 }
AuthenticationScheme
AuthenticationScheme: { BEARER: "Bearer", POP: "pop", SSH: "ssh-cert" }
Type
{ BEARER: "Bearer", POP: "pop", SSH: "ssh-cert" }
AzureCloudInstance
AzureCloudInstance: { AzureChina: "https://login.chinacloudapi.cn", AzureGermany: "https://login.microsoftonline.de", AzurePpe: "https://login.windows-ppe.net", AzurePublic: "https://login.microsoftonline.com", AzureUsGovernment: "https://login.microsoftonline.us", None: "none" }
Type
{ AzureChina: "https://login.chinacloudapi.cn", AzureGermany: "https://login.microsoftonline.de", AzurePpe: "https://login.windows-ppe.net", AzurePublic: "https://login.microsoftonline.com", AzureUsGovernment: "https://login.microsoftonline.us", None: "none" }
BrowserCacheLocation
BrowserCacheLocation: { LocalStorage: "localStorage", MemoryStorage: "memoryStorage", SessionStorage: "sessionStorage" }
Type
{ LocalStorage: "localStorage", MemoryStorage: "memoryStorage", SessionStorage: "sessionStorage" }
CacheLookupPolicy
CacheLookupPolicy: { AccessToken: 1, AccessTokenAndRefreshToken: 2, Default: 0, RefreshToken: 3, RefreshTokenAndNetwork: 4, Skip: 5 }
Type
{ AccessToken: 1, AccessTokenAndRefreshToken: 2, Default: 0, RefreshToken: 3, RefreshTokenAndNetwork: 4, Skip: 5 }
EventType
EventType: { ACQUIRE_TOKEN_FAILURE: "msal:acquireTokenFailure", ACQUIRE_TOKEN_NETWORK_START: "msal:acquireTokenFromNetworkStart", ACQUIRE_TOKEN_START: "msal:acquireTokenStart", ACQUIRE_TOKEN_SUCCESS: "msal:acquireTokenSuccess", ACTIVE_ACCOUNT_CHANGED: "msal:activeAccountChanged", BROKERED_REQUEST_FAILURE: "msal:brokeredRequestFailure", BROKERED_REQUEST_START: "msal:brokeredRequestStart", BROKERED_REQUEST_SUCCESS: "msal:brokeredRequestSuccess", BROKER_CONNECTION_ESTABLISHED: "msal:brokerConnectionEstablished", HANDLE_REDIRECT_END: "msal:handleRedirectEnd", HANDLE_REDIRECT_START: "msal:handleRedirectStart", INITIALIZE_END: "msal:initializeEnd", INITIALIZE_START: "msal:initializeStart", LOGIN_SUCCESS: "msal:loginSuccess", LOGOUT_END: "msal:logoutEnd", LOGOUT_FAILURE: "msal:logoutFailure", LOGOUT_START: "msal:logoutStart", LOGOUT_SUCCESS: "msal:logoutSuccess", POPUP_OPENED: "msal:popupOpened", RESTORE_FROM_BFCACHE: "msal:restoreFromBFCache" }
Type
{ ACQUIRE_TOKEN_FAILURE: "msal:acquireTokenFailure", ACQUIRE_TOKEN_NETWORK_START: "msal:acquireTokenFromNetworkStart", ACQUIRE_TOKEN_START: "msal:acquireTokenStart", ACQUIRE_TOKEN_SUCCESS: "msal:acquireTokenSuccess", ACTIVE_ACCOUNT_CHANGED: "msal:activeAccountChanged", BROKERED_REQUEST_FAILURE: "msal:brokeredRequestFailure", BROKERED_REQUEST_START: "msal:brokeredRequestStart", BROKERED_REQUEST_SUCCESS: "msal:brokeredRequestSuccess", BROKER_CONNECTION_ESTABLISHED: "msal:brokerConnectionEstablished", HANDLE_REDIRECT_END: "msal:handleRedirectEnd", HANDLE_REDIRECT_START: "msal:handleRedirectStart", INITIALIZE_END: "msal:initializeEnd", INITIALIZE_START: "msal:initializeStart", LOGIN_SUCCESS: "msal:loginSuccess", LOGOUT_END: "msal:logoutEnd", LOGOUT_FAILURE: "msal:logoutFailure", LOGOUT_START: "msal:logoutStart", LOGOUT_SUCCESS: "msal:logoutSuccess", POPUP_OPENED: "msal:popupOpened", RESTORE_FROM_BFCACHE: "msal:restoreFromBFCache" }
InteractionStatus
Types of interaction currently in progress. Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.
InteractionStatus: { AcquireToken: "acquireToken", HandleRedirect: "handleRedirect", Logout: "logout", None: "none", Startup: "startup" }
Type
{ AcquireToken: "acquireToken", HandleRedirect: "handleRedirect", Logout: "logout", None: "none", Startup: "startup" }
JsonWebTokenTypes
JsonWebTokenTypes: { Jwk: "JWK", Jwt: "JWT", Pop: "pop" }
Type
{ Jwk: "JWK", Jwt: "JWT", Pop: "pop" }
ProtocolMode
Protocol modes supported by MSAL.
ProtocolMode: { AAD: "AAD", EAR: "EAR", OIDC: "OIDC" }
Type
{ AAD: "AAD", EAR: "EAR", OIDC: "OIDC" }
ResponseMode
ResponseMode: { FORM_POST: "form_post", FRAGMENT: "fragment", QUERY: "query" }
Type
{ FORM_POST: "form_post", FRAGMENT: "fragment", QUERY: "query" }
WrapperSKU
WrapperSKU: { Angular: "@azure/msal-angular", React: "@azure/msal-react" }
Type
{ Angular: "@azure/msal-angular", React: "@azure/msal-react" }
DEFAULT_IFRAME_TIMEOUT_MS
DEFAULT_IFRAME_TIMEOUT_MS: 10000
Type
10000
OIDC_DEFAULT_SCOPES
OIDC_DEFAULT_SCOPES: string[]
Type
string[]
PromptValue
PromptValue: { CONSENT: string, CREATE: string, LOGIN: string, NONE: string, NO_SESSION: string, SELECT_ACCOUNT: string }
Type
{ CONSENT: string, CREATE: string, LOGIN: string, NONE: string, NO_SESSION: string, SELECT_ACCOUNT: string }
stubbedPublicClientApplication
version
version: "5.1.0"
Type
"5.1.0"