BrowserAuthError class

Browser library error class thrown by the MSAL.js library for SPAs

Extends

AuthError

Constructors

BrowserAuthError(string, string)

Inherited Properties

correlationId

CorrelationId associated with the error

errorCode

Short string denoting error

errorMessage

Detailed description of error

message
name
stack
subError

Describes the subclass of an error

Methods

createAuthCodeOrNativeAccountIdRequiredError()

Create an error when an authorization code or native account ID is required but not provided

createAuthCodeRequiredError()

Create an error when an authorization code is required but not provided

createAuthRequestNotSetError()

Creates an error thrown when handleCodeResponse is called before initiateAuthRequest (InteractionHandler)

createBlockAcquireTokenInPopupsError()

Creates an error thrown when a popup attempts to call an acquireToken API

createBlockReloadInHiddenIframeError()

Creates an error thrown when an auth reload is done inside an iframe.

createCryptoNotAvailableError(string)

Creates an error thrown when the crypto object is unavailable.

createDatabaseNotOpenError()

Create an error thrown when indexDB database is not open

createDatabaseUnavailableError()

Create an error when IndexedDB is unavailable

createEmptyHashError(string)

Creates an error thrown when the hash string value is unexpectedly empty.

createEmptyNavigationUriError()

Creates an error thrown when the navigation URI is empty.

createEmptyWindowCreatedError()

Creates an error thrown when window.open returns an empty window object.

createFailedToParseNetworkResponseError(string)

Create an error thrown when network client fails to parse network response

createGetRequestFailedError(string, string)

Create an error thrown when get request fails due to reasons other than internet connectivity

createHashDoesNotContainKnownPropertiesError()

Creates an error thrown when the hash string value does not contain known properties

createHashDoesNotContainStateError()

Creates an error thrown when the hash string value is unexpectedly empty.

createHttpMethodNotImplementedError(string)

Creates an error thrown when an HTTP method hasn't been implemented by the browser class.

createIframeClosedPrematurelyError()

Creates an error thrown when an iframe is found to be closed before the timeout is reached.

createInteractionInProgressError()

Creates an error thrown when a browser interaction (redirect or popup) is in progress.

createInvalidCacheTypeError()

Creates an error thrown if cache type is invalid.

createMonitorIframeTimeoutError()

Creates an error thrown when monitorIframeFromHash times out for a given iframe.

createMonitorPopupTimeoutError()

Creates an error thrown when monitorPopupFromHash times out for a given popup.

createNativeBrokerCalledBeforeInitialize()

Create an error thrown when the initialize function hasn't been called

createNativeConnectionNotEstablishedError()

Create an error when native connection has not been established

createNativeExtensionNotInstalledError()

Create an error thrown when browser extension is not installed

createNativeHandshakeTimeoutError()

Create an error thrown when Handshake with browser extension times out

createNativePromptParameterNotSupportedError()

Create an error thrown when requesting a token directly from the native platform with an unsupported prompt parameter e.g. select_account, login or create These requests must go through eSTS to ensure eSTS is aware of the new account

createNoAccountError()

Creates an error thrown when the account object is not provided in the acquireTokenSilent API.

createNoCachedAuthorityError()

Creates an error thrown when the authority could not be retrieved from the cache

createNonBrowserEnvironmentError()

Create an error thrown when login and token requests are made from a non-browser environment

createNoNetworkConnectivityError()

Create an error thrown when token fetch fails due to no internet

createNoTokenRequestCacheError()

Creates an error thrown when the token request could not be retrieved from the cache

createPkceNotGeneratedError(string)

Creates an error thrown when PKCE is not implemented.

createPopupWindowError(string)

Creates an error thrown when the popup window could not be opened.

createPostRequestFailedError(string, string)

Create an error thrown when token fetch fails due to reasons other than internet connectivity

createRedirectInIframeError(boolean)

Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.

createSigningKeyNotFoundInStorageError(string)

Create an error thrown when the queried cryptographic key is not found in IndexedDB

createSilentLogoutUnsupportedError()

Creates an error thrown when the logout API is called on any of the silent interaction clients

createSilentPromptValueError(string)

Creates an error thrown when a given prompt value is invalid for silent requests.

createStateInteractionTypeMismatchError()

Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume it.

createUnableToAcquireTokenFromNativePlatformError()

Create an error when native token acquisition is not possible

createUnableToLoadTokenError(string)

Create an error thrown when the necessary information is not available to sideload tokens

createUnableToParseStateError()

Creates an error thrown when the hash string value is unexpectedly empty.

createUnableToParseTokenRequestCacheError()

Creates an error thrown when the cached token request could not be retrieved from the cache

createUserCancelledError()

Creates an error thrown when the user closes a popup.

Inherited Methods

createPostRequestFailed(string)

Creates an error for post request failures.

createUnexpectedError(string)

Creates an error that is thrown when something unexpected happens in the library.

setCorrelationId(string)

Constructor Details

BrowserAuthError(string, string)

new BrowserAuthError(errorCode: string, errorMessage?: string)

Parameters

errorCode

string

errorMessage

string

Inherited Property Details

correlationId

CorrelationId associated with the error

correlationId: string

Property Value

string

Inherited From AuthError.correlationId

errorCode

Short string denoting error

errorCode: string

Property Value

string

Inherited From AuthError.errorCode

errorMessage

Detailed description of error

errorMessage: string

Property Value

string

Inherited From AuthError.errorMessage

message

message: string

Property Value

string

Inherited From Error.message

name

name: string

Property Value

string

Inherited From Error.name

stack

stack?: string

Property Value

string

Inherited From Error.stack

subError

Describes the subclass of an error

subError: string

Property Value

string

Inherited From AuthError.subError

Method Details

createAuthCodeOrNativeAccountIdRequiredError()

Create an error when an authorization code or native account ID is required but not provided

static function createAuthCodeOrNativeAccountIdRequiredError(): BrowserAuthError

Returns

createAuthCodeRequiredError()

Create an error when an authorization code is required but not provided

static function createAuthCodeRequiredError(): BrowserAuthError

Returns

createAuthRequestNotSetError()

Creates an error thrown when handleCodeResponse is called before initiateAuthRequest (InteractionHandler)

static function createAuthRequestNotSetError(): BrowserAuthError

Returns

createBlockAcquireTokenInPopupsError()

Creates an error thrown when a popup attempts to call an acquireToken API

static function createBlockAcquireTokenInPopupsError(): BrowserAuthError

Returns

createBlockReloadInHiddenIframeError()

Creates an error thrown when an auth reload is done inside an iframe.

static function createBlockReloadInHiddenIframeError(): BrowserAuthError

Returns

createCryptoNotAvailableError(string)

Creates an error thrown when the crypto object is unavailable.

static function createCryptoNotAvailableError(errDetail: string): BrowserAuthError

Parameters

errDetail

string

Returns

createDatabaseNotOpenError()

Create an error thrown when indexDB database is not open

static function createDatabaseNotOpenError(): BrowserAuthError

Returns

createDatabaseUnavailableError()

Create an error when IndexedDB is unavailable

static function createDatabaseUnavailableError(): BrowserAuthError

Returns

createEmptyHashError(string)

Creates an error thrown when the hash string value is unexpectedly empty.

static function createEmptyHashError(hashValue: string): BrowserAuthError

Parameters

hashValue

string

Returns

createEmptyNavigationUriError()

Creates an error thrown when the navigation URI is empty.

static function createEmptyNavigationUriError(): BrowserAuthError

Returns

createEmptyWindowCreatedError()

Creates an error thrown when window.open returns an empty window object.

static function createEmptyWindowCreatedError(): BrowserAuthError

Returns

createFailedToParseNetworkResponseError(string)

Create an error thrown when network client fails to parse network response

static function createFailedToParseNetworkResponseError(endpoint: string): BrowserAuthError

Parameters

endpoint

string

Returns

createGetRequestFailedError(string, string)

Create an error thrown when get request fails due to reasons other than internet connectivity

static function createGetRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError

Parameters

errorDesc

string

endpoint

string

Returns

createHashDoesNotContainKnownPropertiesError()

Creates an error thrown when the hash string value does not contain known properties

static function createHashDoesNotContainKnownPropertiesError(): BrowserAuthError

Returns

createHashDoesNotContainStateError()

Creates an error thrown when the hash string value is unexpectedly empty.

static function createHashDoesNotContainStateError(): BrowserAuthError

Returns

createHttpMethodNotImplementedError(string)

Creates an error thrown when an HTTP method hasn't been implemented by the browser class.

static function createHttpMethodNotImplementedError(method: string): BrowserAuthError

Parameters

method

string

Returns

createIframeClosedPrematurelyError()

Creates an error thrown when an iframe is found to be closed before the timeout is reached.

static function createIframeClosedPrematurelyError(): BrowserAuthError

Returns

createInteractionInProgressError()

Creates an error thrown when a browser interaction (redirect or popup) is in progress.

static function createInteractionInProgressError(): BrowserAuthError

Returns

createInvalidCacheTypeError()

Creates an error thrown if cache type is invalid.

static function createInvalidCacheTypeError(): BrowserAuthError

Returns

createMonitorIframeTimeoutError()

Creates an error thrown when monitorIframeFromHash times out for a given iframe.

static function createMonitorIframeTimeoutError(): BrowserAuthError

Returns

createMonitorPopupTimeoutError()

Creates an error thrown when monitorPopupFromHash times out for a given popup.

static function createMonitorPopupTimeoutError(): BrowserAuthError

Returns

createNativeBrokerCalledBeforeInitialize()

Create an error thrown when the initialize function hasn't been called

static function createNativeBrokerCalledBeforeInitialize(): BrowserAuthError

Returns

createNativeConnectionNotEstablishedError()

Create an error when native connection has not been established

static function createNativeConnectionNotEstablishedError(): BrowserAuthError

Returns

createNativeExtensionNotInstalledError()

Create an error thrown when browser extension is not installed

static function createNativeExtensionNotInstalledError(): BrowserAuthError

Returns

createNativeHandshakeTimeoutError()

Create an error thrown when Handshake with browser extension times out

static function createNativeHandshakeTimeoutError(): BrowserAuthError

Returns

createNativePromptParameterNotSupportedError()

Create an error thrown when requesting a token directly from the native platform with an unsupported prompt parameter e.g. select_account, login or create These requests must go through eSTS to ensure eSTS is aware of the new account

static function createNativePromptParameterNotSupportedError(): BrowserAuthError

Returns

createNoAccountError()

Creates an error thrown when the account object is not provided in the acquireTokenSilent API.

static function createNoAccountError(): BrowserAuthError

Returns

createNoCachedAuthorityError()

Creates an error thrown when the authority could not be retrieved from the cache

static function createNoCachedAuthorityError(): BrowserAuthError

Returns

createNonBrowserEnvironmentError()

Create an error thrown when login and token requests are made from a non-browser environment

static function createNonBrowserEnvironmentError(): BrowserAuthError

Returns

createNoNetworkConnectivityError()

Create an error thrown when token fetch fails due to no internet

static function createNoNetworkConnectivityError(): BrowserAuthError

Returns

createNoTokenRequestCacheError()

Creates an error thrown when the token request could not be retrieved from the cache

static function createNoTokenRequestCacheError(): BrowserAuthError

Returns

createPkceNotGeneratedError(string)

Creates an error thrown when PKCE is not implemented.

static function createPkceNotGeneratedError(errDetail: string): BrowserAuthError

Parameters

errDetail

string

Returns

createPopupWindowError(string)

Creates an error thrown when the popup window could not be opened.

static function createPopupWindowError(errDetail?: string): BrowserAuthError

Parameters

errDetail

string

Returns

createPostRequestFailedError(string, string)

Create an error thrown when token fetch fails due to reasons other than internet connectivity

static function createPostRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError

Parameters

errorDesc

string

endpoint

string

Returns

createRedirectInIframeError(boolean)

Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.

static function createRedirectInIframeError(windowParentCheck: boolean): BrowserAuthError

Parameters

windowParentCheck

boolean

Returns

createSigningKeyNotFoundInStorageError(string)

Create an error thrown when the queried cryptographic key is not found in IndexedDB

static function createSigningKeyNotFoundInStorageError(keyId: string): BrowserAuthError

Parameters

keyId

string

Returns

createSilentLogoutUnsupportedError()

Creates an error thrown when the logout API is called on any of the silent interaction clients

static function createSilentLogoutUnsupportedError(): BrowserAuthError

Returns

createSilentPromptValueError(string)

Creates an error thrown when a given prompt value is invalid for silent requests.

static function createSilentPromptValueError(givenPrompt: string): BrowserAuthError

Parameters

givenPrompt

string

Returns

createStateInteractionTypeMismatchError()

Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume it.

static function createStateInteractionTypeMismatchError(): BrowserAuthError

Returns

createUnableToAcquireTokenFromNativePlatformError()

Create an error when native token acquisition is not possible

static function createUnableToAcquireTokenFromNativePlatformError(): BrowserAuthError

Returns

createUnableToLoadTokenError(string)

Create an error thrown when the necessary information is not available to sideload tokens

static function createUnableToLoadTokenError(errorDetail: string): BrowserAuthError

Parameters

errorDetail

string

Returns

createUnableToParseStateError()

Creates an error thrown when the hash string value is unexpectedly empty.

static function createUnableToParseStateError(): BrowserAuthError

Returns

createUnableToParseTokenRequestCacheError()

Creates an error thrown when the cached token request could not be retrieved from the cache

static function createUnableToParseTokenRequestCacheError(): BrowserAuthError

Returns

createUserCancelledError()

Creates an error thrown when the user closes a popup.

static function createUserCancelledError(): BrowserAuthError

Returns

Inherited Method Details

createPostRequestFailed(string)

Creates an error for post request failures.

static function createPostRequestFailed(errDesc: string): AuthError

Parameters

errDesc

string

Returns

AuthError

Inherited From AuthError.createPostRequestFailed

createUnexpectedError(string)

Creates an error that is thrown when something unexpected happens in the library.

static function createUnexpectedError(errDesc: string): AuthError

Parameters

errDesc

string

Returns

AuthError

Inherited From AuthError.createUnexpectedError

setCorrelationId(string)

function setCorrelationId(correlationId: string)

Parameters

correlationId

string

Inherited From AuthError.setCorrelationId