ClientCredentialClient class
OAuth2.0 客户端凭据授予
- 扩展
-
@azure/msal-common.BaseClient
方法
| acquire |
用于使用 ClientCredential Flow 获取机密客户端的令牌的公共 API |
| get |
如果缓存了令牌,则查找缓存 |
继承的方法
| create |
为 /token 请求创建查询字符串 |
| send |
使用必要的预检和后检逻辑包装 sendPostRequestAsync |
| update |
更新客户端的颁发机构对象。 终结点发现必须完成。 |
构造函数详细信息
ClientCredentialClient(ClientConfiguration, IAppTokenProvider)
new ClientCredentialClient(configuration: ClientConfiguration, appTokenProvider?: IAppTokenProvider)
参数
- configuration
- @azure/msal-common.ClientConfiguration
- appTokenProvider
- IAppTokenProvider
继承属性详细信息
authority
authority: Authority
属性值
继承自 BaseClient.authority
logger
方法详细信息
acquireToken(CommonClientCredentialRequest)
用于使用 ClientCredential Flow 获取机密客户端的令牌的公共 API
function acquireToken(request: CommonClientCredentialRequest): Promise<null | AuthenticationResult>
参数
- request
- CommonClientCredentialRequest
开发人员提供的 CommonClientCredentialRequest
返回
Promise<null | AuthenticationResult>
getCachedAuthenticationResult(CommonClientCredentialRequest, ClientConfiguration | ManagedIdentityConfiguration, ICrypto, Authority, CacheManager, null | ServerTelemetryManager)
如果缓存了令牌,则查找缓存
function getCachedAuthenticationResult(request: CommonClientCredentialRequest, config: ClientConfiguration | ManagedIdentityConfiguration, cryptoUtils: ICrypto, authority: Authority, cacheManager: CacheManager, serverTelemetryManager?: null | ServerTelemetryManager): Promise<[null | AuthenticationResult, CacheOutcome]>
参数
- request
- CommonClientCredentialRequest
- config
-
@azure/msal-common.ClientConfiguration | ManagedIdentityConfiguration
- cryptoUtils
- ICrypto
- authority
- @azure/msal-common.Authority
- cacheManager
- @azure/msal-common.CacheManager
- serverTelemetryManager
-
null | @azure/msal-common.ServerTelemetryManager
返回
Promise<[null | AuthenticationResult, CacheOutcome]>
继承的方法详细信息
createTokenQueryParameters(BaseAuthRequest)
为 /token 请求创建查询字符串
function createTokenQueryParameters(request: BaseAuthRequest): string
参数
- request
- BaseAuthRequest
返回
string
继承自 BaseClient.createTokenQueryParameters
sendPostRequest<T>(RequestThumbprint, string, NetworkRequestOptions, string)
使用必要的预检和后检逻辑包装 sendPostRequestAsync
function sendPostRequest<T>(thumbprint: RequestThumbprint, tokenEndpoint: string, options: NetworkRequestOptions, correlationId: string): Promise<NetworkResponse<T>>
参数
- thumbprint
- RequestThumbprint
请求限制指纹
- tokenEndpoint
-
string
将 POST 设置为的终结点
- options
- NetworkRequestOptions
要包含在 POST 请求中的正文和标头
- correlationId
-
string
遥测的 CorrelationId
返回
Promise<NetworkResponse<T>>
继承自 BaseClient.sendPostRequest
updateAuthority(string, string)
更新客户端的颁发机构对象。 终结点发现必须完成。
function updateAuthority(cloudInstanceHostname: string, correlationId: string): Promise<void>
参数
- cloudInstanceHostname
-
string
- correlationId
-
string
返回
Promise<void>
继承自 BaseClient.updateAuthority