Skip to content
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

backchannel logout token verification #383

Closed
d3vv3 opened this issue Sep 6, 2022 · 5 comments · Fixed by #484
Closed

backchannel logout token verification #383

d3vv3 opened this issue Sep 6, 2022 · 5 comments · Fixed by #484
Labels
closed:stale Issue or PR has not seen activity recently enhancement New feature or request

Comments

@d3vv3
Copy link

d3vv3 commented Sep 6, 2022

Describe the problem you'd like to have solved

There is currently no implementation of backchannel-logout stated here.

Describe the ideal solution

There should be some sort of path for it (/backchannel-logout for example) to handle the logout_token verification.

Alternatives and current work-arounds

Accessing somehow the private key stated from the lib/appSession.js file and use:

jose.JWT.LogoutToken.verify(
  logout_token,
  keyOrStore,
  {
    issuer: 'https://op.example.com',
    audience: 'urn:example:client_id',
    algorithms: ['PS256']
  }
);
@adamjmcgrath
Copy link
Contributor

Hi @d3vv3 - thanks for your suggestion.

Do you have any opinions on how this SDK (or your app) would invalidate the session upon receiving the logout event?

@adamjmcgrath adamjmcgrath added the enhancement New feature or request label Sep 7, 2022
@d3vv3
Copy link
Author

d3vv3 commented Sep 7, 2022

If I just decode the logout token, someone could be using his session to logout another user (if he had his logout token compromissed). To invalidate the session, it would be enough to do a session.destroy() of some sort.

On the meantime, how can I access the private key to verify it on my own?

Also I am leaving here a backchannel logout summary for other people (Keycloak example):

  1. User sends logout request from one application
  2. The application sends logout request to Keycloak
  3. The Keycloak server invalidates the user session
  4. The Keycloak server then sends a backchannel request to application with an admin url that are associated with the session
  5. When an application receives the logout request it invalidates the corresponding HTTP session

Validation of the logout token is specified here

@adamjmcgrath
Copy link
Contributor

adamjmcgrath commented Sep 7, 2022

Thanks for that @d3vv3

On the meantime, how can I access the private key to verify it on my own?

You use a public key to verify the token in the same way you verify an ID Token, using the AS's well-known jwks_uri or a shared secret (client secret)

  1. When an application receives the logout request it invalidates the corresponding HTTP session

This is what I'm interested in, how you would go about invalidating the session (especially a stateless session like the default for this SDK)

@adamjmcgrath
Copy link
Contributor

Hi @d3vv3 - I have a branch with Back-Channel Logout implemented here https://github.com/auth0/express-openid-connect/blob/back-channel-logout/BACK_CHANNEL_LOGOUT.md

If you're planning on trying it out, would love to hear your feedback

@stale
Copy link

stale bot commented May 21, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:stale Issue or PR has not seen activity recently enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants