@@ -326,7 +326,8 @@ def update_farg(in_response_to, consumer_url, farg=None):
326
326
327
327
def setup_assertion (self , authn , sp_entity_id , in_response_to , consumer_url ,
328
328
name_id , policy , _issuer , authn_statement , identity ,
329
- best_effort , sign_response , farg = None , ** kwargs ):
329
+ best_effort , sign_response , farg = None ,
330
+ session_not_on_or_after = None , ** kwargs ):
330
331
"""
331
332
Construct and return the Assertion
332
333
@@ -370,17 +371,20 @@ def setup_assertion(self, authn, sp_entity_id, in_response_to, consumer_url,
370
371
assertion = ast .construct (
371
372
sp_entity_id , self .config .attribute_converters , policy ,
372
373
issuer = _issuer , farg = farg ['assertion' ], name_id = name_id ,
374
+ session_not_on_or_after = session_not_on_or_after ,
373
375
** authn_args )
374
376
375
377
elif authn_statement : # Got a complete AuthnStatement
376
378
assertion = ast .construct (
377
379
sp_entity_id , self .config .attribute_converters , policy ,
378
380
issuer = _issuer , authn_statem = authn_statement ,
379
- farg = farg ['assertion' ], name_id = name_id , ** kwargs )
381
+ farg = farg ['assertion' ], name_id = name_id ,
382
+ ** kwargs )
380
383
else :
381
384
assertion = ast .construct (
382
385
sp_entity_id , self .config .attribute_converters , policy ,
383
386
issuer = _issuer , farg = farg ['assertion' ], name_id = name_id ,
387
+ session_not_on_or_after = session_not_on_or_after ,
384
388
** kwargs )
385
389
return assertion
386
390
@@ -394,7 +398,7 @@ def _authn_response(self, in_response_to, consumer_url,
394
398
encrypt_assertion_self_contained = False ,
395
399
encrypted_advice_attributes = False ,
396
400
pefim = False , sign_alg = None , digest_alg = None ,
397
- farg = None ):
401
+ farg = None , session_not_on_or_after = None ):
398
402
""" Create a response. A layer of indirection.
399
403
400
404
:param in_response_to: The session identifier of the request
@@ -455,7 +459,7 @@ def _authn_response(self, in_response_to, consumer_url,
455
459
assertion = self .setup_assertion (
456
460
authn , sp_entity_id , in_response_to , consumer_url , name_id ,
457
461
policy , _issuer , authn_statement , [], True , sign_response ,
458
- farg = farg )
462
+ farg = farg , session_not_on_or_after = session_not_on_or_after )
459
463
assertion .advice = saml .Advice ()
460
464
461
465
# assertion.advice.assertion_id_ref.append(saml.AssertionIDRef())
@@ -465,7 +469,8 @@ def _authn_response(self, in_response_to, consumer_url,
465
469
assertion = self .setup_assertion (
466
470
authn , sp_entity_id , in_response_to , consumer_url , name_id ,
467
471
policy , _issuer , authn_statement , identity , True ,
468
- sign_response , farg = farg )
472
+ sign_response , farg = farg ,
473
+ session_not_on_or_after = session_not_on_or_after )
469
474
470
475
to_sign = []
471
476
if not encrypt_assertion :
@@ -681,6 +686,7 @@ def create_authn_response(self, identity, in_response_to, destination,
681
686
encrypt_assertion_self_contained = True ,
682
687
encrypted_advice_attributes = False , pefim = False ,
683
688
sign_alg = None , digest_alg = None ,
689
+ session_not_on_or_after = None ,
684
690
** kwargs ):
685
691
""" Constructs an AuthenticationResponse
686
692
@@ -741,11 +747,13 @@ def create_authn_response(self, identity, in_response_to, destination,
741
747
return self ._authn_response (
742
748
in_response_to , destination , sp_entity_id , identity ,
743
749
authn = _authn , issuer = issuer , pefim = pefim ,
744
- sign_alg = sign_alg , digest_alg = digest_alg , ** args )
750
+ sign_alg = sign_alg , digest_alg = digest_alg ,
751
+ session_not_on_or_after = session_not_on_or_after , ** args )
745
752
return self ._authn_response (
746
753
in_response_to , destination , sp_entity_id , identity ,
747
754
authn = _authn , issuer = issuer , pefim = pefim , sign_alg = sign_alg ,
748
- digest_alg = digest_alg , ** args )
755
+ digest_alg = digest_alg ,
756
+ session_not_on_or_after = session_not_on_or_after , ** args )
749
757
750
758
except MissingValue as exc :
751
759
return self .create_error_response (in_response_to , destination ,
@@ -756,13 +764,15 @@ def create_authn_request_response(self, identity, in_response_to,
756
764
name_id_policy = None , userid = None ,
757
765
name_id = None , authn = None , authn_decl = None ,
758
766
issuer = None , sign_response = False ,
759
- sign_assertion = False , ** kwargs ):
767
+ sign_assertion = False ,
768
+ session_not_on_or_after = None , ** kwargs ):
760
769
761
770
return self .create_authn_response (identity , in_response_to , destination ,
762
771
sp_entity_id , name_id_policy , userid ,
763
772
name_id , authn , issuer ,
764
773
sign_response , sign_assertion ,
765
- authn_decl = authn_decl )
774
+ authn_decl = authn_decl ,
775
+ session_not_on_or_after = session_not_on_or_after )
766
776
767
777
# noinspection PyUnusedLocal
768
778
def create_assertion_id_request_response (self , assertion_id , sign = False ,
0 commit comments