-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add more authentication methods #103
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8f19429
add DummyAuthentication
jaimergp de1a032
draft an OAuth handler (PoC)
jaimergp 2c40d9d
add flask-dance based draft
jaimergp 42a33b7
clean lint
jaimergp a98d70f
blacken
jaimergp 99bbd17
add working oauth
jaimergp fe4e202
enable conda channels again
jaimergp f9a15fb
Clean up a bit
jaimergp 9e20005
Adding jupyterhub authentication
costrouc b47ce2e
Fixing the internal vs. external url issue
costrouc ec21aee
Reference callback url
costrouc de8d5fe
Adding approved callback uri for testing
costrouc 655e928
Adding client id
costrouc 46fd1dd
Adding port for jupyterhub service
costrouc 5f34803
making request of grant type authorization_code
costrouc a5b3ea8
use data instead of json payload
costrouc 9fffb73
Setting the jupyterhub username key
costrouc 7563183
Black formatting
costrouc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
conda-store-server/conda_store_server/server/templates/user.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% extends 'base.html' %} | ||
|
||
{% block title %}User info{% endblock %} | ||
|
||
{% block content %} | ||
|
||
{% block user %} | ||
<div class="text-center"> | ||
<h1 class="h3 mb-3 fw-normal">Logged in as {{ username }}</h1> | ||
{% if email is defined %} | ||
<p><em>Email:</em> {{ email }}</p> | ||
{% endif %} | ||
<form action="/logout/" method="POST"> | ||
<button type="submit" class="btn btn-outline-success my-2 my-sm-0 mr-2">Logout</button> | ||
</form> | ||
</div> | ||
{% endblock %} | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh. I think you are thinking of this differently. Github has a route that should be called within the callback_url method https://api.github.com/user to get the username and organizations that the user is a member of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And conda-store shouldn't keep any information about the user. I'm saying this because every authentication provider is a bit different and may not provide an email/username etc. Additionally not everything logged into conda-store is a user. Often times it will be a service that has authenticated via a conda-store token. So conda-store should only be concerned about storing the authorization that the given authenticated user has (unless we want to handle to complexity of is this a user or a service etc. which I think is unneeded).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am doing that here and then saving the user data as json cookie. I didn't get the organizations yet to save a query and because I want to know how generic this needs to be (organizations might be GH-specific).