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

[WIP] Add option to invalidate tokens on user logout #335

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JammingBen
Copy link

@JammingBen JammingBen commented May 25, 2022

The idea is to have a setting per client that determines if all tokens for this client (and user) should be removed on user logout. Hence we implemented a new flag invalidateOnLogout that can be set per client. Then we hook onto the logout event and simply remove all the tokens for this user which are connected to a client that has invalidateOnLogout set to true.

Motivation/Context

Let's say you have Web running via oauth and log out of oC10. Currently, you will still be logged in in Web because the tokens are not being invalidated.

Fixes owncloud/web#7018

@JammingBen JammingBen self-assigned this May 25, 2022
@CLAassistant
Copy link

CLAassistant commented May 25, 2022

CLA assistant check
All committers have signed the CLA.

@JammingBen
Copy link
Author

I'm having problems with the approach because the logout hook is basically fired all the time when using a client. E.g. when using Web, the hook gets called multiple times when authorizing the first time. Then, when navigating in Web, each action calls the logout again. I traced this down to some legacy code, unfortunately this is where my oC10/auth knowledge ends.

@DeepDiver1975 Maybe you have a clue on what's going on here or a different idea to approach this issue?

@DeepDiver1975
Copy link
Member

What about adding a logout route to the oauth app.

@JammingBen
Copy link
Author

JammingBen commented May 25, 2022

Not sure if I understand correctly, but such route already exists: https://github.com/owncloud/oauth2/blob/master/lib/Controller/PageController.php#L338. The problem still persists: when do we call/redirect to this route? It would need to be called from core, which is a dependency to the oauth2 app that we don't want I assume.

@DeepDiver1975
Copy link
Member

Logout needs to invalidate the access token ....
.... Not too deep into the code base .... 🤷

@DeepDiver1975
Copy link
Member

Let me explain more into depth:

  • when phoenix web is connected via openid connect the used js client lib can make use of openid logout mechanisms
  • the oauth2 protocol has the same mechanisms (if they are the same needs to be verified)
  • so the idea is to implement one of the openid/oauth logout mechanisms in the oc oauths app

overview over openid logout mechanisms: https://curity.io/resources/learn/openid-connect-logout/

which to choose is a task on it's own .....
finally we don't want to reimplement a full openid idp in the oauth2 app .... there has ever since been the idea to fully go into the direction of openid and abandon oauth ........

@pascuflow
Copy link

Not sure if I understand correctly, but such route already exists: https://github.com/owncloud/oauth2/blob/master/lib/Controller/PageController.php#L338. The problem still persists: when do we call/redirect to this route? It would need to be called from core, which is a dependency to the oauth2 app that we don't want I assume.

How could one call this route with curl or Postman? Would it log the user out? This seems like an urgent need while the fancy config option and openid logout mechanisms are fleshed out, some us need a quick programmatic way otherwise Web is completely broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[oC10] Logging out of oC classic does not log out of oC web
4 participants