TokenCredential Class
Protocol for classes able to provide OAuth tokens.
- Inheritance
-
typing_extensions.ProtocolTokenCredential
Constructor
TokenCredential(*args, **kwargs)
Methods
get_token |
Request an access token for scopes. |
get_token
Request an access token for scopes.
get_token(*scopes: str, claims: str | None = None, tenant_id: str | None = None, enable_cae: bool = False, **kwargs: Any) -> AccessToken
Parameters
Name | Description |
---|---|
scopes
Required
|
The type of access needed. |
Keyword-Only Parameters
Name | Description |
---|---|
claims
|
Additional claims required in the token, such as those returned in a resource provider's claims challenge following an authorization failure. |
tenant_id
|
Optional tenant to include in the token request. |
enable_cae
|
Indicates whether to enable Continuous Access Evaluation (CAE) for the requested token. Defaults to False. |
Returns
Type | Description |
---|---|
An AccessToken instance containing the token string and its expiration time in Unix time. |
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Azure SDK for Python