你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ClientSecretCredential Class

Authenticates as a service principal using a client secret.

Inheritance
azure.identity._internal.client_credential_base.ClientCredentialBase
ClientSecretCredential

Constructor

ClientSecretCredential(tenant_id: str, client_id: str, client_secret: str, **kwargs: Any)

Parameters

tenant_id
str
Required

ID of the service principal's tenant. Also called its "directory" ID.

client_id
str
Required

the service principal's client ID

client_secret
str
Required

one of the service principal's client secrets

authority
str

Authority of an Azure Active Directory endpoint, for example "login.microsoftonline.com", the authority for Azure Public Cloud (which is the default). AzureAuthorityHosts defines authorities for other clouds.

cache_persistence_options
TokenCachePersistenceOptions

configuration for persistent token caching. If unspecified, the credential will cache tokens in memory.