UsernamePasswordCredential Class
Authenticates a user with a username and password.
In general, Microsoft doesn't recommend this kind of authentication, because it's less secure than other authentication flows.
Authentication with this credential is not interactive, so it is not compatible with any form of multi-factor authentication or consent prompting. The application must already have consent from the user or a directory admin.
This credential can only authenticate work and school accounts; Microsoft accounts are not supported. See Azure Active Directory documentation for more information about account types.
- Inheritance
-
azure.identity._internal.interactive.InteractiveCredentialUsernamePasswordCredential
Constructor
UsernamePasswordCredential(client_id: str, username: str, password: str, **kwargs: Any)
Parameters
- 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.
- tenant_id
- str
tenant ID or a domain associated with a tenant. If not provided, defaults to the "organizations" tenant, which supports only Azure Active Directory work or school accounts.
- cache_persistence_options
- TokenCachePersistenceOptions
configuration for persistent token caching. If unspecified, the credential will cache tokens in memory.
Feedback
Submit and view feedback for