summaryrefslogtreecommitdiff
path: root/src/saml2/response.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/saml2/response.py')
-rw-r--r--src/saml2/response.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/saml2/response.py b/src/saml2/response.py
index 432fe5de..2c0ef758 100644
--- a/src/saml2/response.py
+++ b/src/saml2/response.py
@@ -1083,13 +1083,11 @@ class AuthnResponse(StatusResponse):
if not context:
continue
- try:
- authn_class = (
- context.authn_context_class_ref.text
- or context.authn_context_decl_ref.text
- )
- except AttributeError:
- authn_class = ""
+ authn_class = (
+ getattr(context.authn_context_class_ref, "text", None)
+ or getattr(context.authn_context_decl_ref, "text", None)
+ or ""
+ )
authenticating_authorities = getattr(
context, "authenticating_authority", []