你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
TokenCredential interface
Represents a credential capable of providing an authentication token.
Methods
get |
Gets the token provided by this credential. This method is called automatically by Azure SDK client libraries. You may call this method directly, but you must also handle token caching and token refreshing. |
Method Details
getToken(string | string[], GetTokenOptions)
Gets the token provided by this credential.
This method is called automatically by Azure SDK client libraries. You may call this method directly, but you must also handle token caching and token refreshing.
function getToken(scopes: string | string[], options?: GetTokenOptions): Promise<null | AccessToken>
Parameters
- scopes
-
string | string[]
The list of scopes for which the token will have access.
- options
- GetTokenOptions
The options used to configure any requests this TokenCredential implementation might make.
Returns
Promise<null | AccessToken>