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

[che-auth] It is not possible to logout in nativeUserMode #20071

Closed
5 tasks done
Tracked by #19182
sparkoo opened this issue Jul 2, 2021 · 1 comment · Fixed by eclipse-che/che-dashboard#320
Closed
5 tasks done
Tracked by #19182

[che-auth] It is not possible to logout in nativeUserMode #20071

sparkoo opened this issue Jul 2, 2021 · 1 comment · Fixed by eclipse-che/che-dashboard#320
Assignees
Labels
area/dashboard kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. sprint/current

Comments

@sparkoo
Copy link
Member

sparkoo commented Jul 2, 2021

Describe the bug

In new nativeUserMode, it is not possible to logout from the dashboard.

The quick and dirty way to log out is to delete all page data from the browser.

Proposed solution

There is an oauth endpoint that signs out the user. <che-url>/oauth/sign_out (for example on CRC with defaults it's https://che-eclipse-che.apps-crc.testing/oauth/sign_out).

Dashboard should be able to recognize nativeUserMode when there is no keycloak. It can tell by getting 404 response from che-server on request /api/keycloak/settings. It is already doing this request at some point and gets into single-user mode after getting 404. Dashboard single-user mode is so far working fine for native-user.

Che version

  • next

Steps to reproduce

  1. deploy che with this che-operator patch AND with devworkspace support --workspace-engine=dev-workspace
apiVersion: org.eclipse.che/v1
kind: CheCluster
metadata:
  name: eclipse-che
spec:
  auth:
    nativeUserMode: true
  1. login as any openshift user
  2. try to logout from the dashboard

Expected behavior

logout should work

Runtime

  • Openshift (include output of oc version)

Screenshots

Installation method

  • chectl
    chectl server:deploy --platform=openshift --installer=operator --workspace-engine=dev-workspace --che-operator-cr-patch-yaml=/tmp/che_cr.yaml

Environment

  • Cloud
    • rhpds

Eclipse Che Logs

Additional context

@sparkoo sparkoo added the kind/bug Outline of a bug - must adhere to the bug report template. label Jul 2, 2021
@sparkoo sparkoo changed the title It is not possible to logout in nativeUserMode [che-auth] It is not possible to logout in nativeUserMode Jul 2, 2021
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Jul 2, 2021
@sleshchenko sleshchenko added area/dashboard sprint/next severity/P1 Has a major impact to usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Jul 2, 2021
@sparkoo
Copy link
Member Author

sparkoo commented Jul 16, 2021

here's very dirty little patch

diff --git a/packages/dashboard-frontend/src/Layout/index.tsx b/packages/dashboard-frontend/src/Layout/index.tsx
index e115c3e5..127885b9 100644
--- a/packages/dashboard-frontend/src/Layout/index.tsx
+++ b/packages/dashboard-frontend/src/Layout/index.tsx
@@ -71,7 +71,7 @@ export class Layout extends React.PureComponent<Props, State> {
   }
 
   private logout(): void {
-    this.keycloakAuthService.logout();
+    window.location.href = '/oauth/sign_out';
   }
 
   private toggleNav(): void {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dashboard kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. sprint/current
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants