- Notifications
You must be signed in to change notification settings - Fork823
Session management#1543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Session management#1543
Uh oh!
There was an error while loading.Please reload this page.
Conversation
926e384 to27f2c7bComparedopry commentedJan 31, 2025
@lullis Thank you for working on this. I've only given it a cursory review, but it looks like a great start. It'll probably be late next week before I can look at this closely. Ping me again if I don't manage to get you a review by next Friday. |
ec3ccd9 to3c3d1bfCompareQup42 commentedApr 28, 2025
@lullis I'm quite busy at the moment. I think that I should be able to have a look at this in the next ~3 months. Do please remind me if I forget it. |
lullis commentedJul 5, 2025
@Qup42, just pinging to remind you about this PR. |
dopry commentedJul 11, 2025
@lullis any guidance on testing procedures for this PR? |
lullis commentedJul 12, 2025
@dopry I got a small app going to test these features athttps://codeberg.org/raphael/oidc-client-testbed. I won't make any strong claims about its overall quality (I relied on Cursor to generate a lot of the boilerplate and the vue components), but I did check the actual functionality and it works well enough to check the session frame part. |
dopry commentedAug 11, 2025
@lullis I was wondering more about test plans I could follow for testing manually. I can try to use your OIDC test bed, we also have the test/app/rp which we can use, although it may need to be updated. Not sure if I have session handling in that client. |
lullis commentedAug 12, 2025
@dopry, I am reasonably confident that there is nothing about session handling in that client - at least not related to the session iframe. If started my vue app precisely because I couldn't find any demo application that exercised this functionality. Anyway, I was testing this with my app by running both the idp and the vue app. You can then login through the vue app, which will authenticate you in the idp. Once you login there will be a "session info" tab that will show you as logged in. You can open a console and you will see that the rp has an iframe which will be pinging the idp every few seconds. If you open another tab and logout directly on the IDP, the session will be finished and the rp will then show you as logged out. |
dopry commentedAug 13, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
the RP uses my svelte-oidc package which is a proxy tohttps://github.com/DuendeArchive/identity-model-oidc-client-js more or less. I'm fairly certainhttps://github.com/DuendeArchive/identity-model-oidc-client-js/blob/dev/src/SessionMonitor.js handles session management in that library. Whether the tests/app/rp has session management enabled is another question. I've been meaning to update that tohttps://github.com/authts/oidc-client-ts, which is a TS port of the same library. |
dopry left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looking good... just two items stand out to me at the moment upon a quick review.
Uh oh!
There was an error while loading.Please reload this page.
| If unset, the default location is used, eg if ``django-oauth-toolkit`` is | ||
| mounted at ``/o/``, it will be ``<server-address>/o/userinfo/``. | ||
| OIDC_SESSION_IFRAME_ENDPOINT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why allow an iframe endpoint setting? It seems like this could become a support headache. Couldn't someone just override the url view if they wanted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Good question. To be honest I was just following the pattern established by the UserInfoView, which seems to do something similar?
…ion-1_0.html)To enable it, user must add OIDC_SESSION_MANAGEMENT_ENABLED and provideOIDC_SESSION_MANAGEMENT_DEFAULT_SESSION_KEY on OAUTH2_PROVIDER settings,and add the proper middleware.This PR contains: - change in AuthorizationView to return 'session_state' parameter in authentication response - a SessionIFrameView as part of the OIDC views, which renders the content of the iframe used by RPs to keep track of session state changes. - middleware that sets the cookie - Documentation - Test for the changed authentication view
codecovbot commentedAug 14, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report?Let us know! |
dopry commentedAug 21, 2025
Looks like we have at least 4 more code branches to test in order to get coverage where it needs to be. |
lullis commentedAug 29, 2025
@dopry added missing tests, looks like codecov is happy now... |
hansegucker commentedOct 2, 2025
@dopry Would be great if we could get forward with this feature, too ;-) |
dopry commentedOct 31, 2025
A way you can help streamline the review process for me is lay out an easy end to end tests for me using the tests/rp and tests/idp or some other setup using docker compose so I can verify the functionality more easily without needing to implement a client to test each of these features myself. |
lullis commentedNov 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Can you please check ifhttps://codeberg.org/raphael/oidc-client-testbed would work for you? It does have a way to test the session iframe. I can make a docker image if you want, as well. |
dopry commentedNov 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I only have a few hours a week for work on this project... Having to spin up and configure a 3rd party example will eat up all my review time for a week. 3rd Party examples do not create an easy way for other developers to test the features in the future, nor does it provide example implementations for consumers. I'd really like to keep all the functionality demonstration in tests/app/[idp,rp]. That said I'll try to get your example setup to test... just don't expect any additional review by me this week. Ultimately, I want all of this local so we can start working on setting up playwright tests that run through all the features so it's not something maintainers need to do manually with every change. |
Uh oh!
There was an error while loading.Please reload this page.
Fixes#1130
Description of the Change
Implementation of OIDC Session Management. This PR:
OIDC_SESSION_MANAGEMENT_DEFAULT_KEYto be present.OIDC_SESSION_MANAGEMENT_DEFAULT_KEYif the user is not authenticated. This is enough for the OP to indicate whether the end user session has changed (logged in, logged out)Checklist
CHANGELOG.mdupdated (only for user relevant changes)AUTHORS