InteractiveBrowserCredential Class

Opens a browser to interactively authenticate a user.

<xref:azure.identity.get_token> opens a browser to a login URL provided by Azure Active Directory and authenticates a user there with the authorization code flow, using PKCE (Proof Key for Code Exchange) internally to protect the code.

Inheritance
azure.identity._internal.interactive.InteractiveCredential
InteractiveBrowserCredential

Constructor

InteractiveBrowserCredential(**kwargs)

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

an Azure Active Directory tenant ID. Defaults to the 'organizations' tenant, which can authenticate work or school accounts.

client_id
str

Client ID of the Azure Active Directory application users will sign in to. If unspecified, users will authenticate to an Azure development application.

redirect_uri
str

a redirect URI for the application identified by client_id as configured in Azure Active Directory, for example "http://localhost:8400". This is only required when passing a value for client_id, and must match a redirect URI in the application's registration. The credential must be able to bind a socket to this URI.

authentication_record
<xref:AuthenticationRecord>

AuthenticationRecord returned by <xref:azure.identity.authenticate>

disable_automatic_authentication
bool

if True, <xref:azure.identity.get_token> will raise AuthenticationRequiredError when user interaction is required to acquire a token. Defaults to False.

cache_persistence_options
TokenCachePersistenceOptions

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

timeout
int

seconds to wait for the user to complete authentication. Defaults to 300 (5 minutes).