@@ -482,6 +482,7 @@ def initiate_auth_code_flow(
482
482
login_hint = None , # type: Optional[str]
483
483
domain_hint = None , # type: Optional[str]
484
484
claims_challenge = None ,
485
+ max_age = None ,
485
486
):
486
487
"""Initiate an auth code flow.
487
488
@@ -512,6 +513,15 @@ def initiate_auth_code_flow(
512
513
`here <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
513
514
`here <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
514
515
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
+
515
525
:return:
516
526
The auth code flow. It is a dict in this form::
517
527
@@ -541,6 +551,7 @@ def initiate_auth_code_flow(
541
551
domain_hint = domain_hint ,
542
552
claims = _merge_claims_challenge_and_capabilities (
543
553
self ._client_capabilities , claims_challenge ),
554
+ max_age = max_age ,
544
555
)
545
556
flow ["claims_challenge" ] = claims_challenge
546
557
return flow
@@ -1323,6 +1334,7 @@ def acquire_token_interactive(
1323
1334
timeout = None ,
1324
1335
port = None ,
1325
1336
extra_scopes_to_consent = None ,
1337
+ max_age = None ,
1326
1338
** kwargs ):
1327
1339
"""Acquire token interactively i.e. via a local browser.
1328
1340
@@ -1368,6 +1380,15 @@ def acquire_token_interactive(
1368
1380
in the same interaction, but for which you won't get back a
1369
1381
token for in this particular operation.
1370
1382
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
+
1371
1392
:return:
1372
1393
- A dict containing no "error" key,
1373
1394
and typically contains an "access_token" key.
@@ -1386,6 +1407,7 @@ def acquire_token_interactive(
1386
1407
port = port or 0 ),
1387
1408
prompt = prompt ,
1388
1409
login_hint = login_hint ,
1410
+ max_age = max_age ,
1389
1411
timeout = timeout ,
1390
1412
auth_params = {
1391
1413
"claims" : claims ,
0 commit comments