Skip to content

Allow domain hint #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 14, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion msal/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def get_authorization_request_url(
response_type="code", # Can be "token" if you use Implicit Grant
prompt=None,
nonce=None,
domain_hint=None, # type: Optional[str]
**kwargs):
"""Constructs a URL for you to start a Authorization Code Grant.

Expand All @@ -251,6 +252,10 @@ def get_authorization_request_url(
:param nonce:
A cryptographically random value used to mitigate replay attacks. See also
`OIDC specs <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
:param domain_hint:
Provides a hint about the tenant or domain that the user should use to sign in. The value
of the domain hint is a registered domain for the tenant.
https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code
:return: The authorization url as a string.
"""
""" # TBD: this would only be meaningful in a new acquire_token_interactive()
Expand Down Expand Up @@ -280,7 +285,7 @@ def get_authorization_request_url(
redirect_uri=redirect_uri, state=state, login_hint=login_hint,
prompt=prompt,
scope=decorate_scope(scopes, self.client_id),
nonce=nonce,
nonce=nonce, domain_hint=domain_hint,
)

def acquire_token_by_authorization_code(
Expand Down