Don't add authn_statement unless actually defined.
This commit is contained in:
@@ -673,10 +673,9 @@ class Assertion(dict):
|
|||||||
else:
|
else:
|
||||||
_authn_statement = None
|
_authn_statement = None
|
||||||
|
|
||||||
return assertion_factory(
|
_ass = assertion_factory(
|
||||||
issuer=issuer,
|
issuer=issuer,
|
||||||
attribute_statement=[attr_statement],
|
attribute_statement=[attr_statement],
|
||||||
authn_statement=[_authn_statement],
|
|
||||||
conditions=conds,
|
conditions=conds,
|
||||||
subject=factory(
|
subject=factory(
|
||||||
saml.Subject,
|
saml.Subject,
|
||||||
@@ -692,6 +691,11 @@ class Assertion(dict):
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if _authn_statement:
|
||||||
|
_ass.authn_statement = [_authn_statement]
|
||||||
|
|
||||||
|
return _ass
|
||||||
|
|
||||||
def apply_policy(self, sp_entity_id, policy, metadata=None):
|
def apply_policy(self, sp_entity_id, policy, metadata=None):
|
||||||
""" Apply policy to the assertion I'm representing
|
""" Apply policy to the assertion I'm representing
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user