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

Allow to easily grab JWT token from UI (dashboard, theia, etc.) #13852

Closed
benoitf opened this issue Jul 15, 2019 · 6 comments · Fixed by eclipse-che/che-dashboard#107
Closed
Assignees
Labels
area/dashboard kind/enhancement A feature request - must adhere to the feature request template.
Milestone

Comments

@benoitf
Copy link
Contributor

benoitf commented Jul 15, 2019

Is your enhancement related to a problem? Please describe.

Sometimes I need to get my user token / JWT token and I open developer mode console to get the token. But it should be another simple way to do that like clicking on a button from the dashboard or the IDE

Describe the solution you'd like

It could be like in openshift console (copy login button)

Describe alternatives you've considered

I would use any UI allowing me to do that !

Additional context

@benoitf benoitf added the kind/enhancement A feature request - must adhere to the feature request template. label Jul 15, 2019
@benoitf benoitf changed the title Allow to easily grab JWT token from UI (dashboard or theia or) Allow to easily grab JWT token from UI (dashboard, theia, etc.) Jul 15, 2019
@nickboldt nickboldt added this to the 7.x milestone Jul 15, 2019
@rhopp
Copy link
Contributor

rhopp commented Jul 16, 2019

Instead of exposing token in UI, I think it would be better, if our cli tools could operate with user/pass authentication.
That way, token would be needed only for direct API calls, which should be reserved for even more advanced users (devs, automated testing, ...)

@benoitf
Copy link
Contributor Author

benoitf commented Jul 16, 2019

@rhopp there are a lot of users with oAuth so you'll open a browser from the CLI ?

@rhopp
Copy link
Contributor

rhopp commented Jul 19, 2019

That's something that came to my mind after pressing send on my comment. TBH I don't know what would be best... It just doesn't make much sense to me. Let's say I want to start workspace from devfile (I have the URL to the devfile for example). I need to open browser, go to che UI (dahboard), copy token and then go to terminal to use the token. To me it seems much better to create the workspace directly in the UI, while I'm already there.
Only scenario I can imagine right now where the cli comes to my mind is when I would like to script something (which doesn't make much sense to me right now as well).

If we could make the cli work without any need to go to browser to obtain some info, that would be perfect. Otherwise I think if we force user to go to the UI, why should he go back to cli?

@RickJWagner
Copy link
Contributor

Related Product Issue: https://issues.redhat.com/browse/CRW-591

@sleshchenko
Copy link
Member

sleshchenko commented Jul 30, 2020

It could be like in openshift console (copy login button)

Update: OpenShift Console backend is not able to access user's token anymore(HTTP only cookies). Instead, OpenShift console has Get Token button that opens a dedicated application that is hosted on a different host that only allows us to copy the token.
I assume OpenShift Console support some plugins (but I'm not sure) and such workflow allows avoiding token leak.
Since Che Dashboard does not have any plugin - we should be good with the scenario where the user gets token directly from the dashboard.

Copy user token could appear in context menu of account (in the left-hand side of the footer)
JWT token could appear in context many of recent workspaces.

@sleshchenko
Copy link
Member

I think for the existing dashboard we could simply add item under account dropdown that will copy to clipboard chectl/crwctl auth:login https://che.openshift.io/api --token=<refresh_keycloak_token>
Screenshot_20201021_143621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dashboard kind/enhancement A feature request - must adhere to the feature request template.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

7 participants