Skip to content

Commit b903d97

Browse files
smalihaider-daasic00kiemon5ter
authored andcommitted
Remove user entry from the user_db in the case of stateless flow
1 parent bece3e2 commit b903d97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/satosa/frontends/openid_connect.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ def __init__(self, auth_req_callback_func, internal_attributes, conf, base_url,
6767
)
6868

6969
db_uri = self.config.get("db_uri")
70+
self.stateless = StorageBase.type(db_uri) == "stateless"
7071
self.user_db = (
7172
StorageBase.from_uri(db_uri, db_name="satosa", collection="authz_codes")
72-
if db_uri and not StorageBase.type(db_uri) == "stateless"
73+
if db_uri and not self.stateless
7374
else {}
7475
)
7576

@@ -130,6 +131,9 @@ def handle_authn_response(self, context, internal_resp):
130131
self._get_extra_id_token_claims(user_id, client_id),
131132
)
132133

134+
if self.stateless:
135+
del self.user_db[internal_resp.subject_id]
136+
133137
del context.state[self.name]
134138
http_response = auth_resp.request(auth_req["redirect_uri"], should_fragment_encode(auth_req))
135139
return SeeOther(http_response)

0 commit comments

Comments
 (0)