Authenticates as a service principal using a client secret.
ConstructorClientSecretCredential(tenant_id: str, client_id: str, client_secret: str, **kwargs: Any)
Parameters Keyword-Only Parameters Examples
Create a ClientSecretCredential.
from azure.identity import ClientSecretCredential
credential = ClientSecretCredential(
tenant_id="<tenant_id>",
client_id="<client_id>",
client_secret="<client_secret>",
)
Methods close
Close the credential's underlying HTTP client and release resources.
get_tokenRequest an access token for scopes.
This method is called automatically by Azure SDK clients.
get_token_infoRequest an access token for scopes.
This is an alternative to get_token to enable certain scenarios that require additional properties on the token. This method is called automatically by Azure SDK clients.
closeClose the credential's underlying HTTP client and release resources.
close() -> None
get_token
Request an access token for scopes.
This method is called automatically by Azure SDK clients.
get_token(*scopes: str, claims: str | None = None, tenant_id: str | None = None, enable_cae: bool = False, **kwargs: Any) -> AccessToken
Parameters Keyword-Only Parameters Returns Exceptions get_token_info
Request an access token for scopes.
This is an alternative to get_token to enable certain scenarios that require additional properties on the token. This method is called automatically by Azure SDK clients.
get_token_info(*scopes: str, options: TokenRequestOptions | None = None) -> AccessTokenInfo
Parameters Keyword-Only Parameters Returns Exceptions
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4