p2-inc / idp-wizard

Identity Provider setup wizards for Keycloak
https://phasetwo.io
Other
1 stars 1 forks source link

Logout link not functional #93

Closed xgp closed 2 years ago

xgp commented 2 years ago

Logout link needs to call keycloak.logout() and redirect to login (should be automatic)

jeffpatzer commented 2 years ago

Does this happen in a specific way? There are two "Logout" links and both follow this format

              <Button variant="link" isInline onClick={() => keycloak.logout()}>
                Logout
              </Button>

which seems correct. It logs me out and I get redirected to the Log in page.

xgp commented 2 years ago

https://user-images.githubusercontent.com/244253/163942790-6ce5f044-e2f7-4868-8bc7-dc435fb4c9d0.mov

This was the report I got from Plotly. Happening from the dashboard page.

xgp commented 2 years ago

Since /dashboard isn't actually a path the backend knows about, it returns a 404. Can we use the redirect_uri option in the logout to send them to the root path (e.g. /auth/realms/<realm>/wizard)?

https://www.keycloak.org/docs/latest/securing_apps/#logout-options

jeffpatzer commented 2 years ago

@xgp yeah I can pass through the location to send it to I believe. Thanks for that video, I assumed it was the setup once deployed that was throwing the issue.

jeffpatzer commented 2 years ago

Ok, there is also a way to generate a "logout url". So I tried that and made it an actual link. Let's see if that does the trick. /dashboard shouldn't matter since that's only in the query param as a redirect after login.