-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add http root to OIDC back channel logout handlers #42524
Add http root to OIDC back channel logout handlers #42524
Conversation
This comment has been minimized.
This comment has been minimized.
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.
Change makes sense.
- I think you should add information to the https://quarkus.io/guides/all-config#quarkus-oidc_quarkus-oidc-logout-backchannel-path JavaDoc about that. For example look here https://quarkus.io/guides/all-config#quarkus-rest_quarkus-rest-path as they mention that path is relative to the root path.
- I think you are expecting too much from users, I don't know if they always set root path in form
/path
or they do/path/
orpath
etc. Same goes for the backchannel path. I wonder if you should do something likeio.quarkus.deployment.util.UriNormalizationUtil.normalizeWithBase(httpRootPath, oidcTenantConfig.logout.backchannel.path.get(), true).toString()
(UPDATE: well, that's in deployment module, so probably some other util). If you don't want to do that, maybe just document expected value for this config property. (talking aboutrootPath + backChannelPath
code)
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/BackChannelLogoutHandler.java
Show resolved
Hide resolved
746f10a
to
a17b30a
Compare
Thanks @michalvavrik,
Sure, just did it, also noting the back channel logout path must start from '/' for now at least, as it has been an expectation from the very start
May be we should have that utility code available in the runtime as well... For now, I did a few tweaks to ensure it is always in the Would you like me to tweak something else ? |
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.
Would you like me to tweak something else ?
No, LGTM. Thanks.
Sounds good, thanks. |
🎊 PR Preview 35f4c4a has been successfully built and deployed to https://quarkus-pr-main-42524-preview.surge.sh/version/main/guides/
|
Status for workflow
|
Fixes #42483.
Simple PR to take the http root path into consideration when creating OIDC back channel logout handlers.
Backchannel logout is typically used to logout a user from all the applications, to support a global logout. For example, a user explicitly logs out from one Quarkus application and then the OIDC provider will separately notify all other registered Quarkus services to clear the session when the user attempts to access them.
The existing test code is here, and I can confirm it failed initially with this PR before I fixed it to use en empty http root prefix if it is set as
/
, since the back channel logout path also starts from/
.To really test that an http root like
/a
is taken account, I'd need to create a new integration test module, which I'm not too keen :-) given the simplicity of the fix. If I add an http root configuration tointegration-tests/oidc-wiremock
where the backchannel test is available, then it would impact a real lot of tests.Let me know what you think please