Skip to content

Commit 2801eb1

Browse files
committed
Make the AuthnContextClassRefs available through the context
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 76a48f3 commit 2801eb1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/satosa/context.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Context(object):
1818
KEY_TARGET_ENTITYID = 'target_entity_id'
1919
KEY_FORCE_AUTHN = 'force_authn'
2020
KEY_MEMORIZED_IDP = 'memorized_idp'
21+
KEY_AUTHN_CONTEXT_CLASS_REF = 'authn_context_class_ref'
2122

2223
def __init__(self):
2324
self._path = None

src/satosa/frontends/saml2.py

+5
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ def _handle_authn_request(self, context, binding_in, idp):
247247
idp, idp_policy, requester, context.state
248248
)
249249

250+
authn_context_class_ref_nodes = getattr(
251+
authn_req.requested_authn_context, 'authn_context_class_ref', []
252+
)
253+
authn_context = [ref.text for ref in authn_context_class_ref_nodes]
254+
context.decorate(Context.KEY_AUTHN_CONTEXT_CLASS_REF, authn_context)
250255
context.decorate(Context.KEY_METADATA_STORE, self.idp.metadata)
251256
return self.auth_req_callback_func(context, internal_req)
252257

0 commit comments

Comments
 (0)