Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/oidcop/session/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from oidcop.exception import ConfigurationError
from oidcop.token import handler
from oidcop.util import Crypt
from oidcop.session.database import NoSuchClientSession
from .database import Database
from .grant import Grant
from .grant import SessionToken
Expand Down Expand Up @@ -226,9 +227,11 @@ def create_session(
if not client_id:
client_id = auth_req["client_id"]

client_info = ClientSessionInfo(client_id=client_id)

self.set([user_id, client_id], client_info)
try:
self.get([user_id, client_id])
except (NoSuchClientSession, ValueError):
client_info = ClientSessionInfo(client_id=client_id)
self.set([user_id, client_id], client_info)

return self.create_grant(
auth_req=auth_req,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_34_oidc_sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,4 @@ def test_sso(self):

assert len(csi1.subordinate) == 2
assert len(csi2.subordinate) == 1
assert len(csi3.subordinate) == 1
assert len(csi3.subordinate) == 2