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

Support getting an auth token when logging in through OpenID Connect #125

Closed
machristie opened this issue Dec 14, 2017 · 3 comments
Closed

Comments

@machristie
Copy link
Collaborator

There are several ways of generating a Django REST Framework auth token but they all either require a username and password or by using the admin or manage.py commands. There isn't, as far as I can tell, a self-service way for a user authenticating with OpenID Connect to get an auth token.

Implementing such a view should be seems pretty simple though. Essentially we need a view that requires SessionAuthentication and generates and returns a token.

The motivation for having such a view is to allow OpenID Connect users of CloudLaunch to be able to authenticate from the cloudlaunch-cli.

@afgane
Copy link
Contributor

afgane commented Dec 14, 2017

If I'm following along, I think this would also pave a path for authenticating with cloud providers without us needing to store or acquire credentials directly from the user but could instead request temporary creds from a cloud provider (e.g., AWS) based on the identity token from an authentication provider (e.g., Google).

@machristie
Copy link
Collaborator Author

machristie commented Dec 15, 2017

@afgane this is not nearly so ambitious as that 😄

Let me try to explain it this way. If a user goes to https://beta.launch.usegalaxy.org/ today and logs in through GitHub, how would that user obtain a DRF auth token? The user doesn't have a password so the user can't go to https://beta.launch.usegalaxy.org/cloudlaunch/api/v1/auth/login/ to login and get an auth token. That's why I think, in this situation, we need a custom view that would generate an auth token for a user if the user is already logged in (SessionAuthentication).

@afgane
Copy link
Contributor

afgane commented Dec 15, 2017

This clarified the workflow/idea. Yes - sounds like we'll need that.

machristie added a commit to machristie/cloudlaunch that referenced this issue Dec 19, 2017
afgane added a commit that referenced this issue Dec 20, 2017
Issue #125: get_auth_token view returns token for logged in user
@afgane afgane closed this as completed Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants