@@ -558,6 +558,7 @@ def initiate_auth_code_flow(
558
558
login_hint = None , # type: Optional[str]
559
559
domain_hint = None , # type: Optional[str]
560
560
claims_challenge = None ,
561
+ max_age = None ,
561
562
):
562
563
"""Initiate an auth code flow.
563
564
@@ -588,6 +589,17 @@ def initiate_auth_code_flow(
588
589
`here <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
589
590
`here <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
590
591
592
+ :param int max_age:
593
+ OPTIONAL. Maximum Authentication Age.
594
+ Specifies the allowable elapsed time in seconds
595
+ since the last time the End-User was actively authenticated.
596
+ If the elapsed time is greater than this value,
597
+ Microsoft identity platform will actively re-authenticate the End-User.
598
+
599
+ MSAL Python will also automatically validate the auth_time in ID token.
600
+
601
+ New in version 1.15.
602
+
591
603
:return:
592
604
The auth code flow. It is a dict in this form::
593
605
@@ -617,6 +629,7 @@ def initiate_auth_code_flow(
617
629
domain_hint = domain_hint ,
618
630
claims = _merge_claims_challenge_and_capabilities (
619
631
self ._client_capabilities , claims_challenge ),
632
+ max_age = max_age ,
620
633
)
621
634
flow ["claims_challenge" ] = claims_challenge
622
635
return flow
@@ -1403,6 +1416,7 @@ def acquire_token_interactive(
1403
1416
timeout = None ,
1404
1417
port = None ,
1405
1418
extra_scopes_to_consent = None ,
1419
+ max_age = None ,
1406
1420
** kwargs ):
1407
1421
"""Acquire token interactively i.e. via a local browser.
1408
1422
@@ -1448,6 +1462,17 @@ def acquire_token_interactive(
1448
1462
in the same interaction, but for which you won't get back a
1449
1463
token for in this particular operation.
1450
1464
1465
+ :param int max_age:
1466
+ OPTIONAL. Maximum Authentication Age.
1467
+ Specifies the allowable elapsed time in seconds
1468
+ since the last time the End-User was actively authenticated.
1469
+ If the elapsed time is greater than this value,
1470
+ Microsoft identity platform will actively re-authenticate the End-User.
1471
+
1472
+ MSAL Python will also automatically validate the auth_time in ID token.
1473
+
1474
+ New in version 1.15.
1475
+
1451
1476
:return:
1452
1477
- A dict containing no "error" key,
1453
1478
and typically contains an "access_token" key.
@@ -1466,6 +1491,7 @@ def acquire_token_interactive(
1466
1491
port = port or 0 ),
1467
1492
prompt = prompt ,
1468
1493
login_hint = login_hint ,
1494
+ max_age = max_age ,
1469
1495
timeout = timeout ,
1470
1496
auth_params = {
1471
1497
"claims" : claims ,
0 commit comments