Skip to content

Commit 52bf4c9

Browse files
committed
1 parent efbc83a commit 52bf4c9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

msal/application.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ def initiate_auth_code_flow(
482482
login_hint=None, # type: Optional[str]
483483
domain_hint=None, # type: Optional[str]
484484
claims_challenge=None,
485+
max_age=None,
485486
):
486487
"""Initiate an auth code flow.
487488
@@ -512,6 +513,15 @@ def initiate_auth_code_flow(
512513
`here <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
513514
`here <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
514515
516+
:param int max_age:
517+
OPTIONAL. Maximum Authentication Age.
518+
Specifies the allowable elapsed time in seconds
519+
since the last time the End-User was actively authenticated.
520+
If the elapsed time is greater than this value,
521+
Microsoft identity platform will actively re-authenticate the End-User.
522+
523+
New in version 1.14.
524+
515525
:return:
516526
The auth code flow. It is a dict in this form::
517527
@@ -541,6 +551,7 @@ def initiate_auth_code_flow(
541551
domain_hint=domain_hint,
542552
claims=_merge_claims_challenge_and_capabilities(
543553
self._client_capabilities, claims_challenge),
554+
max_age=max_age,
544555
)
545556
flow["claims_challenge"] = claims_challenge
546557
return flow
@@ -1323,6 +1334,7 @@ def acquire_token_interactive(
13231334
timeout=None,
13241335
port=None,
13251336
extra_scopes_to_consent=None,
1337+
max_age=None,
13261338
**kwargs):
13271339
"""Acquire token interactively i.e. via a local browser.
13281340
@@ -1368,6 +1380,15 @@ def acquire_token_interactive(
13681380
in the same interaction, but for which you won't get back a
13691381
token for in this particular operation.
13701382
1383+
:param int max_age:
1384+
OPTIONAL. Maximum Authentication Age.
1385+
Specifies the allowable elapsed time in seconds
1386+
since the last time the End-User was actively authenticated.
1387+
If the elapsed time is greater than this value,
1388+
Microsoft identity platform will actively re-authenticate the End-User.
1389+
1390+
New in version 1.14.
1391+
13711392
:return:
13721393
- A dict containing no "error" key,
13731394
and typically contains an "access_token" key.
@@ -1386,6 +1407,7 @@ def acquire_token_interactive(
13861407
port=port or 0),
13871408
prompt=prompt,
13881409
login_hint=login_hint,
1410+
max_age=max_age,
13891411
timeout=timeout,
13901412
auth_params={
13911413
"claims": claims,

0 commit comments

Comments
 (0)