@azure/msal-node package
Classes
| AuthError |
General error class thrown by the MSAL.js library. |
| ClientApplication |
Base abstract class for all ClientApplications - public and confidential |
| ClientAssertion |
Client assertion of type jwt-bearer used in confidential client flows |
| 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. |
| ClientCredentialClient |
OAuth2.0 client credential grant |
| ConfidentialClientApplication |
This class is to be used to acquire tokens for confidential client applications (webApp, webAPI). Confidential client applications will configure application secrets, client certificates/assertions as applicable |
| CryptoProvider |
This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636). |
| DeviceCodeClient |
OAuth2.0 Device code client |
| DistributedCachePlugin |
Cache plugin that serializes data to the cache and deserializes data from the cache |
| InteractionRequiredAuthError |
Error thrown when user interaction is required. |
| Logger |
Class which facilitates logging of messages to a specific place. |
| ManagedIdentityApplication |
Class to initialize a managed identity and identify the service |
| OnBehalfOfClient |
On-Behalf-Of client |
| PublicClientApplication |
This class is to be used to acquire tokens for public client applications (desktop, mobile). Public client applications are not trusted to safely store application secrets, and therefore can only request tokens in the name of an user. |
| ServerError |
Error thrown when there is an error with the server code, for example, unavailability. |
| TokenCache |
In-memory token cache manager |
| TokenCacheContext |
This class instance helps track the memory changes facilitating decisions to read from and write to the persistent cache |
| UsernamePasswordClient |
Oauth2.0 Password grant client Note: We are only supporting public clients for password grant and for purely testing purposes |
Interfaces
| IAppTokenProvider | |
| ICacheClient |
Interface for the cache that defines a getter and setter |
| ICachePlugin | |
| IConfidentialClientApplication |
Interface for the ConfidentialClientApplication class defining the public API signatures |
| ILoopbackClient |
Interface for LoopbackClient allowing to replace the default loopback server with a custom implementation. |
| INativeBrokerPlugin | |
| INetworkModule |
Client network interface to send backend requests. |
| IPartitionManager |
Interface that defines getter methods to get keys used to identity data in the cache |
| IPublicClientApplication |
Interface for the PublicClientApplication class defining the public API signatures |
| ISerializableTokenCache | |
| ITokenCache |
Token cache interface for the client, giving access to cache APIs |
Type Aliases
| AccountInfo |
Account object with the following signature:
|
| AppTokenProviderParameters |
Input object for the IAppTokenProvider extensiblity. MSAL will create this object, which can be used to help create an AppTokenProviderResult.
|
| AppTokenProviderResult |
Output object for IAppTokenProvider extensiblity.
|
| AuthenticationResult |
Result returned from the authority's token endpoint.
|
| AuthorizationCodePayload |
Response returned after processing the code response query string or fragment. |
| AuthorizationCodeRequest |
Request object passed by user to acquire a token from the server exchanging a valid authorization code (second leg of OAuth2.0 Authorization Code flow)
|
| AuthorizationUrlRequest |
Request object passed by user to retrieve a Code from the server (first leg of authorization code grant flow)
|
| AuthorizeResponse |
Response properties that may be returned by the /authorize endpoint |
| AzureCloudOptions |
AzureCloudInstance specific options
|
| BrokerOptions |
Use this to configure the below broker options:
Note: These options are only available for PublicClientApplications using the Authorization Code Flow |
| CacheKVStore |
Key value store for in-memory cache |
| CacheOptions |
Use this to configure the below cache configuration options:
|
| ClientAssertionCallback | |
| ClientCredentialRequest |
CommonClientCredentialRequest
|
| Configuration |
Use the configuration object to configure MSAL and initialize the client application object
|
| DeviceCodeRequest |
Parameters for Oauth2 device code flow.
|
| IdTokenClaims |
Type which describes Id Token claims known by MSAL. |
| InMemoryCache |
Intermittent type to handle in-memory data objects with defined types |
| InteractiveRequest |
Request object passed by user to configure acquireTokenInteractive API
|
| JsonCache |
Cache format read from the cache blob provided to the configuration during app instantiation |
| ManagedIdentityConfiguration | |
| ManagedIdentityIdParams | |
| ManagedIdentityRequestParams |
ManagedIdentityRequest
|
| NetworkRequestOptions |
Options allowed by network request APIs. |
| NetworkResponse | |
| NodeAuthOptions |
|
| NodeSystemOptions |
Type for configuring logger and http client options
|
| NodeTelemetryOptions | |
| OnBehalfOfRequest |
|
| RefreshTokenRequest |
CommonRefreshTokenRequest
|
| SerializedAccessTokenEntity |
Access token credential type |
| SerializedAccountEntity |
Account type |
| SerializedAppMetadataEntity |
AppMetadata type |
| SerializedIdTokenEntity |
Idtoken credential type |
| SerializedRefreshTokenEntity |
Refresh token credential type |
| SignOutRequest | |
| SilentFlowRequest |
SilentFlow parameters passed by the user to retrieve credentials silently
|
| UsernamePasswordRequest |
UsernamePassword parameters passed by the user to retrieve credentials Note: The latest OAuth 2.0 Security Best Current Practice disallows the password grant entirely. This flow is added for internal testing.
|
Enums
| LogLevel |
Log message level. |
Variables
| Azure |
|
| Managed |
Managed Identity Source Names |
| Protocol |
Protocol modes supported by MSAL. |
| Response |
allowed values for response_mode |
| Auth |
AuthErrorMessage class containing string constants used by error codes and messages. |
| Client |
String constants used by error codes and messages. |
| Client |
ClientConfigurationErrorMessage class containing string constants used by error codes and messages. |
| Interaction |
Interaction required errors defined by the SDK |
| Prompt |
we considered making this "enum" in the request instead of string, however it looks like the allowed list of prompt values kept changing over past couple of years. There are some undocumented prompt values for some internal partners too, hence the choice of generic "string" type instead of the "enum" |
| version |
Variable Details
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" }
ManagedIdentitySourceNames
Managed Identity Source Names
ManagedIdentitySourceNames: { APP_SERVICE: "AppService", AZURE_ARC: "AzureArc", CLOUD_SHELL: "CloudShell", DEFAULT_TO_IMDS: "DefaultToImds", IMDS: "Imds", MACHINE_LEARNING: "MachineLearning", SERVICE_FABRIC: "ServiceFabric" }
Type
{ APP_SERVICE: "AppService", AZURE_ARC: "AzureArc", CLOUD_SHELL: "CloudShell", DEFAULT_TO_IMDS: "DefaultToImds", IMDS: "Imds", MACHINE_LEARNING: "MachineLearning", SERVICE_FABRIC: "ServiceFabric" }
ProtocolMode
Protocol modes supported by MSAL.
ProtocolMode: { AAD: "AAD", EAR: "EAR", OIDC: "OIDC" }
Type
{ AAD: "AAD", EAR: "EAR", OIDC: "OIDC" }
ResponseMode
allowed values for response_mode
ResponseMode: { FORM_POST: "form_post", FRAGMENT: "fragment", QUERY: "query" }
Type
{ FORM_POST: "form_post", FRAGMENT: "fragment", QUERY: "query" }
AuthErrorMessage
Warning
This API is now deprecated.
Use AuthErrorCodes instead
AuthErrorMessage class containing string constants used by error codes and messages.
AuthErrorMessage: { postRequestFailed: { code: string, desc: string }, unexpectedError: { code: string, desc: string } }
Type
{ postRequestFailed: { code: string, desc: string }, unexpectedError: { code: string, desc: string } }
ClientAuthErrorMessage
Warning
This API is now deprecated.
Use ClientAuthErrorCodes instead
String constants used by error codes and messages.
ClientAuthErrorMessage: { DeviceCodeExpired: { code: string, desc: string }, DeviceCodePollingCancelled: { code: string, desc: string }, DeviceCodeUnknownError: { code: string, desc: string }, NoAccountInSilentRequest: { code: string, desc: string }, appendScopeSetError: { code: string, desc: string }, authTimeNotFoundError: { code: string, desc: string }, bindingKeyNotRemovedError: { code: string, desc: string }, clientInfoDecodingError: { code: string, desc: string }, clientInfoEmptyError: { code: string, desc: string }, emptyInputScopeSetError: { code: string, desc: string }, endpointResolutionError: { code: string, desc: string }, hashNotDeserialized: { code: string, desc: string }, invalidAssertion: { code: string, desc: string }, invalidCacheEnvironment: { code: string, desc: string }, invalidCacheRecord: { code: string, desc: string }, invalidClientCredential: { code: string, desc: string }, invalidStateError: { code: string, desc: string }, keyIdMissing: { code: string, desc: string }, logoutNotSupported: { code: string, desc: string }, maxAgeTranspired: { code: string, desc: string }, missingTenantIdError: { code: string, desc: string }, multipleMatchingAccounts: { code: string, desc: string }, multipleMatchingAppMetadata: { code: string, desc: string }, multipleMatchingTokens: { code: string, desc: string }, nestedAppAuthBridgeDisabled: { code: string, desc: string }, networkError: { code: string, desc: string }, noAccountFound: { code: string, desc: string }, noAuthorizationCodeFromServer: { code: string, desc: string }, noCryptoObj: { code: string, desc: string }, noNetworkConnectivity: { code: string, desc: string }, nonceMismatchError: { code: string, desc: string }, nullOrEmptyToken: { code: string, desc: string }, platformBrokerError: { code: string, desc: string }, removeEmptyScopeError: { code: string, desc: string }, stateMismatchError: { code: string, desc: string }, stateNotFoundError: { code: string, desc: string }, tokenClaimsRequired: { code: string, desc: string }, tokenParsingError: { code: string, desc: string }, tokenRefreshRequired: { code: string, desc: string }, tokenRequestCannotBeMade: { code: string, desc: string }, unableToGetOpenidConfigError: { code: string, desc: string }, unexpectedCredentialType: { code: string, desc: string }, userCanceledError: { code: string, desc: string }, userTimeoutReached: { code: string, desc: string } }
Type
{ DeviceCodeExpired: { code: string, desc: string }, DeviceCodePollingCancelled: { code: string, desc: string }, DeviceCodeUnknownError: { code: string, desc: string }, NoAccountInSilentRequest: { code: string, desc: string }, appendScopeSetError: { code: string, desc: string }, authTimeNotFoundError: { code: string, desc: string }, bindingKeyNotRemovedError: { code: string, desc: string }, clientInfoDecodingError: { code: string, desc: string }, clientInfoEmptyError: { code: string, desc: string }, emptyInputScopeSetError: { code: string, desc: string }, endpointResolutionError: { code: string, desc: string }, hashNotDeserialized: { code: string, desc: string }, invalidAssertion: { code: string, desc: string }, invalidCacheEnvironment: { code: string, desc: string }, invalidCacheRecord: { code: string, desc: string }, invalidClientCredential: { code: string, desc: string }, invalidStateError: { code: string, desc: string }, keyIdMissing: { code: string, desc: string }, logoutNotSupported: { code: string, desc: string }, maxAgeTranspired: { code: string, desc: string }, missingTenantIdError: { code: string, desc: string }, multipleMatchingAccounts: { code: string, desc: string }, multipleMatchingAppMetadata: { code: string, desc: string }, multipleMatchingTokens: { code: string, desc: string }, nestedAppAuthBridgeDisabled: { code: string, desc: string }, networkError: { code: string, desc: string }, noAccountFound: { code: string, desc: string }, noAuthorizationCodeFromServer: { code: string, desc: string }, noCryptoObj: { code: string, desc: string }, noNetworkConnectivity: { code: string, desc: string }, nonceMismatchError: { code: string, desc: string }, nullOrEmptyToken: { code: string, desc: string }, platformBrokerError: { code: string, desc: string }, removeEmptyScopeError: { code: string, desc: string }, stateMismatchError: { code: string, desc: string }, stateNotFoundError: { code: string, desc: string }, tokenClaimsRequired: { code: string, desc: string }, tokenParsingError: { code: string, desc: string }, tokenRefreshRequired: { code: string, desc: string }, tokenRequestCannotBeMade: { code: string, desc: string }, unableToGetOpenidConfigError: { code: string, desc: string }, unexpectedCredentialType: { code: string, desc: string }, userCanceledError: { code: string, desc: string }, userTimeoutReached: { code: string, desc: string } }
ClientConfigurationErrorMessage
Warning
This API is now deprecated.
Use ClientConfigurationErrorCodes instead
ClientConfigurationErrorMessage class containing string constants used by error codes and messages.
ClientConfigurationErrorMessage: { authorityMismatch: { code: string, desc: string }, authorityUriInsecure: { code: string, desc: string }, cannotAllowPlatformBroker: { code: string, desc: string }, cannotSetOIDCOptions: { code: string, desc: string }, claimsRequestParsingError: { code: string, desc: string }, emptyScopesError: { code: string, desc: string }, invalidAuthenticationHeader: { code: string, desc: string }, invalidAuthorityMetadata: { code: string, desc: string }, invalidAuthorizePostBodyParameters: { code: string, desc: string }, invalidClaimsRequest: { code: string, desc: string }, invalidCloudDiscoveryMetadata: { code: string, desc: string }, invalidCodeChallengeMethod: { code: string, desc: string }, invalidCodeChallengeParams: { code: string, desc: string }, invalidPlatformBrokerConfiguration: { code: string, desc: string }, invalidRequestMethodForEAR: { code: string, desc: string }, logoutRequestEmptyError: { code: string, desc: string }, missingNonceAuthenticationHeader: { code: string, desc: string }, missingSshJwk: { code: string, desc: string }, missingSshKid: { code: string, desc: string }, redirectUriNotSet: { code: string, desc: string }, tokenRequestEmptyError: { code: string, desc: string }, untrustedAuthority: { code: string, desc: string }, urlEmptyError: { code: string, desc: string }, urlParseError: { code: string, desc: string } }
Type
{ authorityMismatch: { code: string, desc: string }, authorityUriInsecure: { code: string, desc: string }, cannotAllowPlatformBroker: { code: string, desc: string }, cannotSetOIDCOptions: { code: string, desc: string }, claimsRequestParsingError: { code: string, desc: string }, emptyScopesError: { code: string, desc: string }, invalidAuthenticationHeader: { code: string, desc: string }, invalidAuthorityMetadata: { code: string, desc: string }, invalidAuthorizePostBodyParameters: { code: string, desc: string }, invalidClaimsRequest: { code: string, desc: string }, invalidCloudDiscoveryMetadata: { code: string, desc: string }, invalidCodeChallengeMethod: { code: string, desc: string }, invalidCodeChallengeParams: { code: string, desc: string }, invalidPlatformBrokerConfiguration: { code: string, desc: string }, invalidRequestMethodForEAR: { code: string, desc: string }, logoutRequestEmptyError: { code: string, desc: string }, missingNonceAuthenticationHeader: { code: string, desc: string }, missingSshJwk: { code: string, desc: string }, missingSshKid: { code: string, desc: string }, redirectUriNotSet: { code: string, desc: string }, tokenRequestEmptyError: { code: string, desc: string }, untrustedAuthority: { code: string, desc: string }, urlEmptyError: { code: string, desc: string }, urlParseError: { code: string, desc: string } }
InteractionRequiredAuthErrorMessage
Warning
This API is now deprecated.
Use InteractionRequiredAuthErrorCodes instead
Interaction required errors defined by the SDK
InteractionRequiredAuthErrorMessage: { bad_token: { code: string, desc: string }, interrupted_user: { code: string, desc: string }, native_account_unavailable: { code: string, desc: string }, noTokensFoundError: { code: string, desc: string } }
Type
{ bad_token: { code: string, desc: string }, interrupted_user: { code: string, desc: string }, native_account_unavailable: { code: string, desc: string }, noTokensFoundError: { code: string, desc: string } }
PromptValue
we considered making this "enum" in the request instead of string, however it looks like the allowed list of prompt values kept changing over past couple of years. There are some undocumented prompt values for some internal partners too, hence the choice of generic "string" type instead of the "enum"
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 }
version
version: "3.8.10"
Type
"3.8.10"