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

[FLI-1041] [Bug]: Logout seems broken #3131

Closed
1 task done
markphelps opened this issue May 28, 2024 · 1 comment · Fixed by #3133
Closed
1 task done

[FLI-1041] [Bug]: Logout seems broken #3131

markphelps opened this issue May 28, 2024 · 1 comment · Fixed by #3133
Labels
Milestone

Comments

@markphelps
Copy link
Collaborator

markphelps commented May 28, 2024

Bug Description

I've noticed this when using OIDC auth with Keycloak, this likely might be broken for other OIDC auth providers as well.

Whenever Im logged in using Keycloak OIDC, and I click logout in the UI, it doesn't actually log me out. Or at least if it does, it quickly re-logs me back in.

mp4 attached:

2024-05-28.16.28.28.mp4

Version Info

Main

Search

  • I searched for other open and closed issues before opening this

Steps to Reproduce

  1. Setup Keycloak for OIDC
  2. Configure Flipt, config below:
authentication:
  required: true
  session:
    domain: localhost
  methods:
    oidc:
      enabled: true
      providers:
        keycloak:
          issuer_url: http://localhost:8080/realms/flipt
          redirect_address: http://localhost:8081
          client_id: flipt
          client_secret: <redacted>
  1. Login via Keycloak
  2. Try to logout
  3. Notice behavior above

Expected Behavior

Log out of Flipt UI, cookies and sessions are cleared. Get returned back to Flipt login screen

Additional Context

This could be due to my change in #3082, as the iss issued from the Keycloak token is:

iss":"http://localhost:8080/realms/flipt"

FLI-1041

@markphelps markphelps added the bug label May 28, 2024
@markphelps markphelps changed the title [Bug]: Logout seems broken [FLI-1041] [Bug]: Logout seems broken May 28, 2024
@GeorgeMac
Copy link
Member

Perhaps @markphelps we need to await expireAuthSelf():
https://github.com/flipt-io/flipt/pull/3082/files#diff-ec6405e76cd840d6ca99f49eeaa2e747155b209f2776b0ac228f4d319314def5R60
My guess is this is a race on that expire self request being handled by the browser before it navigates away to the issuer.
Prior to that you had the explicit then() promise chain.
We need to have that request be handled by the browser context first, so that the response tells it to clear that specific cookie.

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

Successfully merging a pull request may close this issue.

2 participants