Skip to content

Commit 61785a7

Browse files
authored
Allow domain hint (#181)
1 parent 5c1f0f4 commit 61785a7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

msal/application.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def get_authorization_request_url(
230230
response_type="code", # Can be "token" if you use Implicit Grant
231231
prompt=None,
232232
nonce=None,
233+
domain_hint=None, # type: Optional[str]
233234
**kwargs):
234235
"""Constructs a URL for you to start a Authorization Code Grant.
235236
@@ -251,6 +252,12 @@ def get_authorization_request_url(
251252
:param nonce:
252253
A cryptographically random value used to mitigate replay attacks. See also
253254
`OIDC specs <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
255+
:param domain_hint:
256+
Can be one of "consumers" or "organizations" or your tenant domain "contoso.com".
257+
If included, it will skip the email-based discovery process that user goes
258+
through on the sign-in page, leading to a slightly more streamlined user experience.
259+
https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code
260+
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8
254261
:return: The authorization url as a string.
255262
"""
256263
""" # TBD: this would only be meaningful in a new acquire_token_interactive()
@@ -281,6 +288,7 @@ def get_authorization_request_url(
281288
prompt=prompt,
282289
scope=decorate_scope(scopes, self.client_id),
283290
nonce=nonce,
291+
domain_hint=domain_hint,
284292
)
285293

286294
def acquire_token_by_authorization_code(

0 commit comments

Comments
 (0)