@@ -32,21 +32,23 @@ class InteractiveBrowserCredential(InteractiveCredential):
3232 there with the authorization code flow, using PKCE (Proof Key for Code Exchange) internally to protect the code.
3333
3434 :keyword str authority: Authority of an Azure Active Directory endpoint, for example 'login.microsoftonline.com',
35- the authority for Azure Public Cloud (which is the default). :class:`~azure.identity.AzureAuthorityHosts`
36- defines authorities for other clouds.
35+ the authority for Azure Public Cloud (which is the default). :class:`~azure.identity.AzureAuthorityHosts`
36+ defines authorities for other clouds.
3737 :keyword str tenant_id: an Azure Active Directory tenant ID. Defaults to the 'organizations' tenant, which can
38- authenticate work or school accounts.
38+ authenticate work or school accounts.
3939 :keyword str client_id: Client ID of the Azure Active Directory application users will sign in to. If
40- unspecified, users will authenticate to an Azure development application.
40+ unspecified, users will authenticate to an Azure development application.
41+ :keyword str login_hint: a username suggestion to pre-fill the login page's username/email address field. A user
42+ may still log in with a different username.
4143 :keyword str redirect_uri: a redirect URI for the application identified by `client_id` as configured in Azure
42- Active Directory, for example "http://localhost:8400". This is only required when passing a value for
43- `client_id`, and must match a redirect URI in the application's registration. The credential must be able to
44- bind a socket to this URI.
44+ Active Directory, for example "http://localhost:8400". This is only required when passing a value for
45+ `client_id`, and must match a redirect URI in the application's registration. The credential must be able to
46+ bind a socket to this URI.
4547 :keyword AuthenticationRecord authentication_record: :class:`AuthenticationRecord` returned by :func:`authenticate`
4648 :keyword bool disable_automatic_authentication: if True, :func:`get_token` will raise
47- :class:`AuthenticationRequiredError` when user interaction is required to acquire a token. Defaults to False.
49+ :class:`AuthenticationRequiredError` when user interaction is required to acquire a token. Defaults to False.
4850 :keyword cache_persistence_options: configuration for persistent token caching. If unspecified, the credential
49- will cache tokens in memory.
51+ will cache tokens in memory.
5052 :paramtype cache_persistence_options: ~azure.identity.TokenCachePersistenceOptions
5153 :keyword int timeout: seconds to wait for the user to complete authentication. Defaults to 300 (5 minutes).
5254 :raises ValueError: invalid `redirect_uri`
@@ -62,6 +64,7 @@ def __init__(self, **kwargs):
6264 else :
6365 self ._parsed_url = None
6466
67+ self ._login_hint = kwargs .pop ("login_hint" , None )
6568 self ._timeout = kwargs .pop ("timeout" , 300 )
6669 self ._server_class = kwargs .pop ("_server_class" , AuthCodeRedirectServer )
6770 client_id = kwargs .pop ("client_id" , DEVELOPER_SIGN_ON_CLIENT_ID )
@@ -96,7 +99,11 @@ def _request_token(self, *scopes, **kwargs):
9699 claims = kwargs .get ("claims" )
97100 app = self ._get_app ()
98101 flow = app .initiate_auth_code_flow (
99- scopes , redirect_uri = redirect_uri , prompt = "select_account" , claims_challenge = claims
102+ scopes ,
103+ redirect_uri = redirect_uri ,
104+ prompt = "select_account" ,
105+ claims_challenge = claims ,
106+ login_hint = self ._login_hint ,
100107 )
101108 if "auth_uri" not in flow :
102109 raise CredentialUnavailableError ("Failed to begin authentication flow" )
0 commit comments