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

feat(auth): Add OAuth logout #355

Merged
merged 9 commits into from
Jan 18, 2022
Merged

Conversation

jan-law
Copy link
Contributor

@jan-law jan-law commented Dec 16, 2021

Related https://github.com/cryostatio/cryostat/issues/717

In order to log out of the OAuth server, the frontend needs to make a POST request to the OAuth server's /logout endpoint, which removes the session cookie stored in the OAuth server. The backend will delete the access token and return the /logout url. Note that deleting the access token without removing the session cookie will cause the OAuth server to immediately login a user after logging out.

OpenShift OAuth logout docs
OpenShift OAuth endpoint for deleting access tokens
OpenShift console UI code explaining logout behaviour

@andrewazores
Copy link
Member

If I log in to my CRC developer account without granting it its required permissions, I get this:

image

The error messages appearing due to the failed requests (stemming from permissions denied) are expected. But, I don't have a user menu here and no obvious way to log out from this under-permissioned account.

@jan-law
Copy link
Contributor Author

jan-law commented Jan 17, 2022

I've added an empty state component that will only appear when an account doesn't have the required permissions. "Retry Login" should take you to the OpenShift Container Platform login page.
image

Copy link
Member

@andrewazores andrewazores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent, thank you and very well done.

@andrewazores andrewazores merged commit 7ad6b03 into cryostatio:main Jan 18, 2022
@jan-law jan-law deleted the oauth-logout branch January 18, 2022 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants