-
Notifications
You must be signed in to change notification settings - Fork 31
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
logout to upstream OIDC Provider when logging out from MAS #4249
base: main
Are you sure you want to change the base?
logout to upstream OIDC Provider when logging out from MAS #4249
Conversation
a2ac44f
to
a53c9b4
Compare
695af90
to
0f90080
Compare
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.
Thanks for doing this! This isn't a full review, rather a quick look with a few suggestions
.to_string(); | ||
result.post_logout_redirect_uri = Some(post_logout_redirect_uri.clone()); | ||
|
||
let sessions_cookie = UpstreamSessionsCookie::load(cookie_jar); |
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.
Loading from the cookie is unreliable. You should instead:
- lookup the authentications for the current
user_session
in theuser_session_authentications
- authentications that were done through an upstream will have a reference to a
upstream_oauth_authorization_session_id
- there you can grab the
id_token
received during the auth and extract the subject - you should also pass the id_token to the RP-initiated logout endpoint through the
id_token_hint
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.
Thank you for your review!
I have amended the code but I was not sure if I needed to extract the subject to perform the logout
@@ -39,6 +41,22 @@ pub(crate) async fn post( | |||
.record_browser_session(&clock, &session) | |||
.await; | |||
|
|||
// First, get RP-initiated logout endpoints before actually finishing the |
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.
We need to make sure that this logic also happens when the logout is done through the React frontend. I don't have a good suggestion on how to do so for now though
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.
d32d837
to
7defa02
Compare
bf1b470
to
8e1e912
Compare
8e1e912
to
648a390
Compare
When logging out from MAS we would like to have the ability end the session on the upstream OIDC provider according to the spec : https://openid.net/specs/openid-connect-rpinitiated-1_0.html
If
allow_rp_initiated_logout
is set totrue
, this will end the session on the upstream provider when logging out from MAS.