Skip to content

Commit ccef0aa

Browse files
committed
Fix authn_class fallback from authn_context_class_ref to authn_context_decl_ref
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 92445ac commit ccef0aa

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/saml2/response.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,13 +1083,11 @@ def authn_info(self):
10831083
if not context:
10841084
continue
10851085

1086-
try:
1087-
authn_class = (
1088-
context.authn_context_class_ref.text
1089-
or context.authn_context_decl_ref.text
1090-
)
1091-
except AttributeError:
1092-
authn_class = ""
1086+
authn_class = (
1087+
getattr(context.authn_context_class_ref, "text", None)
1088+
or getattr(context.authn_context_decl_ref, "text", None)
1089+
or ""
1090+
)
10931091

10941092
authenticating_authorities = getattr(
10951093
context, "authenticating_authority", []

0 commit comments

Comments
 (0)