@azure/msal-node package
类
| AuthError |
MSAL.js 库引发的常规错误类。 |
| ClientApplication |
所有 ClientApplication 的基抽象类 - 公共和机密 |
| ClientAssertion |
机密客户端流中使用的 jwt-bearer 类型的客户端断言 |
| ClientAuthError |
在浏览器中运行的客户端代码中出现错误时引发的错误。 |
| ClientConfigurationError |
配置 MSAL.js 库时引发的错误。 |
| ClientCredentialClient |
OAuth2.0 客户端凭据授予 |
| ConfidentialClientApplication |
此类用于获取机密客户端应用程序(webApp、webAPI)的令牌。 机密客户端应用程序将配置应用程序机密、客户端证书/断言(如适用) |
| CryptoProvider |
此类实现 MSAL 节点的加密接口,该接口允许它执行 base64 编码和解码,生成加密随机 GUID,并使用 PKCE 为 OAuth 授权代码流实现代码证明密钥Exchange规范(此处 rfc: https://tools.ietf.org/html/rfc7636 |
| DeviceCodeClient |
OAuth2.0 设备代码客户端 |
| DistributedCachePlugin |
将数据序列化到缓存的缓存插件,并从缓存反序列化数据 |
| InteractionRequiredAuthError |
需要用户交互时引发的错误。 |
| Logger |
有助于将消息记录到特定位置的类。 |
| ManagedIdentityApplication |
用于初始化托管标识和标识服务的类 |
| OnBehalfOfClient |
on-Behalf-Of 客户端 |
| PublicClientApplication |
此类用于获取公共客户端应用程序(桌面、移动版)的令牌。 公共客户端应用程序不受信任,无法安全地存储应用程序机密,因此只能请求用户名中的令牌。 |
| ServerError |
当服务器代码出错(例如不可用)时引发的错误。 |
| TokenCache |
内存中令牌缓存管理器 |
| TokenCacheContext |
此类实例有助于跟踪内存更改,从而做出读取和写入永久性缓存的决定 |
| UsernamePasswordClient |
Oauth2.0 密码授予客户端说明:我们仅支持公共客户端进行密码授予,仅用于纯测试目的 |
接口
| IAppTokenProvider | |
| ICacheClient |
定义 getter 和 setter 的缓存的接口 |
| ICachePlugin | |
| IConfidentialClientApplication |
用于定义公共 API 签名的 ConfidentialClientApplication 类的接口 |
| ILoopbackClient |
允许将默认环回服务器替换为自定义实现的 LoopbackClient 接口。 |
| INativeBrokerPlugin | |
| INetworkModule |
用于发送后端请求的客户端网络接口。 |
| IPartitionManager |
定义 getter 方法的接口,用于获取用于缓存中标识数据的密钥 |
| IPublicClientApplication |
用于定义公共 API 签名的 PublicClientApplication 类的接口 |
| ISerializableTokenCache | |
| ITokenCache |
客户端的令牌缓存接口,授予对缓存 API 的访问权限 |
类型别名
| AccountInfo |
具有以下签名的 Account 对象:
|
| AppTokenProviderParameters |
IAppTokenProvider 扩展性的输入对象。 MSAL 将创建此对象,该对象可用于帮助创建 AppTokenProviderResult。
|
| AppTokenProviderResult |
IAppTokenProvider extensiblity 的输出对象。
|
| AuthenticationResult |
从颁发机构令牌终结点返回的结果。
|
| AuthorizationCodePayload |
处理代码响应查询字符串或片段后返回的响应。 |
| AuthorizationCodeRequest |
用户通过请求对象从服务器获取令牌,交换有效的授权代码(OAuth2.0 授权代码流的第二回合)
|
| AuthorizationUrlRequest |
用户传递的请求对象从服务器检索代码(授权代码授予流的第一回合)
|
| AuthorizeResponse |
/authorize 终结点可能返回的响应属性 |
| AzureCloudOptions |
AzureCloudInstance 特定选项
|
| BrokerOptions |
使用此配置以下中转站选项:
注意:这些选项仅适用于使用授权代码流的 PublicClientApplications |
| CacheKVStore |
内存中缓存的键值存储 |
| CacheOptions |
使用此选项配置以下缓存配置选项:
|
| ClientAssertionCallback | |
| ClientCredentialRequest |
CommonClientCredentialRequest
|
| Configuration |
使用配置对象配置 MSAL 并初始化客户端应用程序对象
|
| DeviceCodeRequest |
Oauth2 设备代码流的参数。
|
| IdTokenClaims |
描述 MSAL 已知的 ID 令牌声明的类型。 |
| InMemoryCache |
用于处理具有已定义类型的内存中数据对象的间歇性类型 |
| InteractiveRequest |
用户传递的请求对象以配置 acquireTokenInteractive API
|
| JsonCache |
在应用实例化期间从提供给配置的缓存 blob 中读取的缓存格式 |
| ManagedIdentityConfiguration | |
| ManagedIdentityIdParams | |
| ManagedIdentityRequestParams |
ManagedIdentityRequest
|
| NetworkRequestOptions |
网络请求 API 允许的选项。 |
| NetworkResponse | |
| NodeAuthOptions |
|
| NodeSystemOptions |
用于配置记录器和 http 客户端选项的类型
|
| NodeTelemetryOptions | |
| OnBehalfOfRequest |
|
| RefreshTokenRequest |
CommonRefreshTokenRequest
|
| SerializedAccessTokenEntity |
访问令牌凭据类型 |
| SerializedAccountEntity |
帐户类型 |
| SerializedAppMetadataEntity |
AppMetadata 类型 |
| SerializedIdTokenEntity |
Idtoken 凭据类型 |
| SerializedRefreshTokenEntity |
刷新令牌凭据类型 |
| SignOutRequest | |
| SilentFlowRequest |
用户传递的 SilentFlow 参数以无提示方式检索凭据
|
| UsernamePasswordRequest |
用户传递的 UsernamePassword 参数检索凭据注意:最新的 OAuth 2.0 安全最佳做法完全不允许授予密码。 此流已添加用于内部测试。
|
枚举
| LogLevel |
日志消息级别。 |
变量
| Azure |
|
| Managed |
托管标识源名称 |
| Protocol |
MSAL 支持的协议模式。 |
| Response |
允许response_mode的值 |
| Auth |
包含错误代码和消息使用的字符串常量的 AuthErrorMessage 类。 |
| Client |
错误代码和消息使用的字符串常量。 |
| Client |
ClientConfigurationErrorMessage 类,包含错误代码和消息使用的字符串常量。 |
| Interaction |
SDK 定义的交互所需的错误 |
| Prompt |
我们考虑在请求而不是字符串中发出此“枚举”,但看起来像允许的提示值列表在过去几年中不断更改。 某些内部合作伙伴也有一些未记录的提示值,因此选择泛型“string”类型而不是“枚举” |
| version |
变量详细信息
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" }
类型
{ 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
托管标识源名称
ManagedIdentitySourceNames: { APP_SERVICE: "AppService", AZURE_ARC: "AzureArc", CLOUD_SHELL: "CloudShell", DEFAULT_TO_IMDS: "DefaultToImds", IMDS: "Imds", MACHINE_LEARNING: "MachineLearning", SERVICE_FABRIC: "ServiceFabric" }
类型
{ APP_SERVICE: "AppService", AZURE_ARC: "AzureArc", CLOUD_SHELL: "CloudShell", DEFAULT_TO_IMDS: "DefaultToImds", IMDS: "Imds", MACHINE_LEARNING: "MachineLearning", SERVICE_FABRIC: "ServiceFabric" }
ProtocolMode
MSAL 支持的协议模式。
ProtocolMode: { AAD: "AAD", EAR: "EAR", OIDC: "OIDC" }
类型
{ AAD: "AAD", EAR: "EAR", OIDC: "OIDC" }
ResponseMode
允许response_mode的值
ResponseMode: { FORM_POST: "form_post", FRAGMENT: "fragment", QUERY: "query" }
类型
{ FORM_POST: "form_post", FRAGMENT: "fragment", QUERY: "query" }
AuthErrorMessage
警告
现已弃用此 API。
Use AuthErrorCodes instead
包含错误代码和消息使用的字符串常量的 AuthErrorMessage 类。
AuthErrorMessage: { postRequestFailed: { code: string, desc: string }, unexpectedError: { code: string, desc: string } }
类型
{ postRequestFailed: { code: string, desc: string }, unexpectedError: { code: string, desc: string } }
ClientAuthErrorMessage
警告
现已弃用此 API。
Use ClientAuthErrorCodes instead
错误代码和消息使用的字符串常量。
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 } }
类型
{ 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
警告
现已弃用此 API。
Use ClientConfigurationErrorCodes instead
ClientConfigurationErrorMessage 类,包含错误代码和消息使用的字符串常量。
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 } }
类型
{ 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
警告
现已弃用此 API。
Use InteractionRequiredAuthErrorCodes instead
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 } }
类型
{ 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
我们考虑在请求而不是字符串中发出此“枚举”,但看起来像允许的提示值列表在过去几年中不断更改。 某些内部合作伙伴也有一些未记录的提示值,因此选择泛型“string”类型而不是“枚举”
PromptValue: { CONSENT: string, CREATE: string, LOGIN: string, NONE: string, NO_SESSION: string, SELECT_ACCOUNT: string }
类型
{ CONSENT: string, CREATE: string, LOGIN: string, NONE: string, NO_SESSION: string, SELECT_ACCOUNT: string }
version
version: "3.8.10"
类型
"3.8.10"