File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ class StatusAuthnFailed(StatusError):
94
94
class StatusInvalidAttrNameOrValue (StatusError ):
95
95
pass
96
96
97
+ class StatusInvalidAuthnResponseStatement (StatusError ):
98
+ pass
99
+
97
100
98
101
class StatusInvalidNameidPolicy (StatusError ):
99
102
pass
@@ -1099,13 +1102,17 @@ def session_info(self):
1099
1102
return {"name_id" : self .name_id , "came_from" : self .came_from ,
1100
1103
"issuer" : self .issuer (), "not_on_or_after" : nooa ,
1101
1104
"authz_decision_info" : self .authz_decision_info ()}
1102
- else :
1105
+ elif getattr ( self . assertion , 'authn_statement' , None ) :
1103
1106
authn_statement = self .assertion .authn_statement [0 ]
1104
1107
return {"ava" : self .ava , "name_id" : self .name_id ,
1105
1108
"came_from" : self .came_from , "issuer" : self .issuer (),
1106
1109
"not_on_or_after" : nooa , "authn_info" : self .authn_info (),
1107
1110
"session_index" : authn_statement .session_index }
1108
-
1111
+ else :
1112
+ raise StatusInvalidAuthnResponseStatement (
1113
+ "The Authn Response Statement is not valid"
1114
+ )
1115
+
1109
1116
def __str__ (self ):
1110
1117
return self .xmlstr
1111
1118
You can’t perform that action at this time.
0 commit comments