13
13
from .context import Context
14
14
from .exception import SATOSAConfigurationError
15
15
from .exception import SATOSAError , SATOSAAuthenticationError , SATOSAUnknownError
16
- from .internal_data import UserIdHasher
17
16
from .logging_util import satosa_logging
18
17
from .micro_services .account_linking import AccountLinking
19
18
from .micro_services .consent import Consent
@@ -119,7 +118,6 @@ def _auth_req_callback_func(self, context, internal_request):
119
118
satosa_logging (logger , logging .INFO ,
120
119
"Requesting provider: {}" .format (internal_request .requester ), state )
121
120
122
- UserIdHasher .save_state (internal_request , state )
123
121
if self .request_micro_services :
124
122
return self .request_micro_services [0 ].process (context , internal_request )
125
123
@@ -131,15 +129,6 @@ def _auth_req_finish(self, context, internal_request):
131
129
return backend .start_auth (context , internal_request )
132
130
133
131
def _auth_resp_finish (self , context , internal_response ):
134
- # re-hash user id since e.g. account linking micro service might have changed it
135
- user_id = UserIdHasher .hash_id (
136
- self .config ["USER_ID_HASH_SALT" ],
137
- internal_response .user_id ,
138
- internal_response .requester ,
139
- context .state )
140
- internal_response .user_id = user_id
141
- internal_response .user_id_hash_type = UserIdHasher .hash_type (
142
- context .state )
143
132
user_id_to_attr = self .config ["INTERNAL_ATTRIBUTES" ].get ("user_id_to_attr" , None )
144
133
if user_id_to_attr :
145
134
internal_response .attributes [user_id_to_attr ] = [internal_response .user_id ]
@@ -187,20 +176,6 @@ def _auth_resp_callback_func(self, context, internal_response):
187
176
]
188
177
internal_response .user_id = "" .join (user_id )
189
178
190
- # The authentication response may not contain a user id. For example
191
- # a SAML IdP may not assert a SAML NameID in the subject and we may
192
- # not be configured to construct one from asserted attributes.
193
- # So only hash the user_id if it is not None.
194
- if internal_response .user_id :
195
- user_id = UserIdHasher .hash_id (
196
- self .config ["USER_ID_HASH_SALT" ],
197
- internal_response .user_id ,
198
- internal_response .requester ,
199
- context .state )
200
- internal_response .user_id = user_id
201
- internal_response .user_id_hash_type = UserIdHasher .hash_type (
202
- context .state )
203
-
204
179
if self .response_micro_services :
205
180
return self .response_micro_services [0 ].process (
206
181
context , internal_response )
0 commit comments