@@ -94,6 +94,21 @@ def set_strict(self, value):
94
94
assert isinstance (value , bool )
95
95
self .__settings .set_strict (value )
96
96
97
+ def store_valid_response (self , response ):
98
+ self .__attributes = response .get_attributes ()
99
+ self .__friendlyname_attributes = response .get_friendlyname_attributes ()
100
+ self .__nameid = response .get_nameid ()
101
+ self .__nameid_format = response .get_nameid_format ()
102
+ self .__nameid_nq = response .get_nameid_nq ()
103
+ self .__nameid_spnq = response .get_nameid_spnq ()
104
+ self .__session_index = response .get_session_index ()
105
+ self .__session_expiration = response .get_session_not_on_or_after ()
106
+ self .__last_message_id = response .get_id ()
107
+ self .__last_assertion_id = response .get_assertion_id ()
108
+ self .__last_authn_contexts = response .get_authn_contexts ()
109
+ self .__authenticated = True
110
+ self .__last_assertion_not_on_or_after = response .get_assertion_not_on_or_after ()
111
+
97
112
def process_response (self , request_id = None ):
98
113
"""
99
114
Process the SAML Response sent by the IdP.
@@ -112,20 +127,7 @@ def process_response(self, request_id=None):
112
127
self .__last_response = response .get_xml_document ()
113
128
114
129
if response .is_valid (self .__request_data , request_id ):
115
- self .__attributes = response .get_attributes ()
116
- self .__friendlyname_attributes = response .get_friendlyname_attributes ()
117
- self .__nameid = response .get_nameid ()
118
- self .__nameid_format = response .get_nameid_format ()
119
- self .__nameid_nq = response .get_nameid_nq ()
120
- self .__nameid_spnq = response .get_nameid_spnq ()
121
- self .__session_index = response .get_session_index ()
122
- self .__session_expiration = response .get_session_not_on_or_after ()
123
- self .__last_message_id = response .get_id ()
124
- self .__last_assertion_id = response .get_assertion_id ()
125
- self .__last_authn_contexts = response .get_authn_contexts ()
126
- self .__authenticated = True
127
- self .__last_assertion_not_on_or_after = response .get_assertion_not_on_or_after ()
128
-
130
+ self .store_valid_response (response )
129
131
else :
130
132
self .__errors .append ('invalid_response' )
131
133
self .__error_reason = response .get_error ()
0 commit comments