Skip to content

Commit 1de6a36

Browse files
committed
Add authenticating authority as part of the internal AuthenticationInformation object
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent e0f6d9d commit 1de6a36

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/satosa/backends/saml2.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,15 +384,18 @@ def _translate_response(self, response, state):
384384
# The response may have been encrypted by the IdP so if we have an
385385
# encryption key, try it.
386386
if self.encryption_keys:
387-
response.parse_assertion(self.encryption_keys)
387+
response.parse_assertion(keys=self.encryption_keys)
388388

389-
authn_info = response.authn_info()[0]
390-
auth_class_ref = authn_info[0]
391-
timestamp = response.assertion.authn_statement[0].authn_instant
392389
issuer = response.response.issuer.text
393-
390+
authn_context_ref, authenticating_authorities, authn_instant = next(
391+
iter(response.authn_info()), [None, None, None]
392+
)
393+
authenticating_authority = next(iter(authenticating_authorities), None)
394394
auth_info = AuthenticationInformation(
395-
auth_class_ref, timestamp, issuer,
395+
auth_class_ref=authn_context_ref,
396+
timestamp=authn_instant,
397+
authority=authenticating_authority,
398+
issuer=issuer,
396399
)
397400

398401
# The SAML response may not include a NameID.

src/satosa/internal.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ class AuthenticationInformation(_Datafy):
8585
"""
8686

8787
def __init__(
88-
self, auth_class_ref=None, timestamp=None, issuer=None, *args, **kwargs
88+
self,
89+
auth_class_ref=None,
90+
timestamp=None,
91+
issuer=None,
92+
authority=None,
93+
*args,
94+
**kwargs,
8995
):
9096
"""
9197
Initiate the data carrier
@@ -102,6 +108,7 @@ def __init__(
102108
self.auth_class_ref = auth_class_ref
103109
self.timestamp = timestamp
104110
self.issuer = issuer
111+
self.authority = authority
105112

106113

107114
class InternalData(_Datafy):

0 commit comments

Comments
 (0)