-
Notifications
You must be signed in to change notification settings - Fork 69
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 2 factor authentication as optional feature #70
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f13707c
Add onetimepass as dependency to native auth
leportella 9e52615
Add onetimepass secret creation on UserInfo orm
leportella d7156ac
Add sn authentication on authenticate method
leportella 1a4efcd
Add two factor auth code on signup template
leportella 0756327
Add 2 factor auth on login template
leportella 215f527
Add two factor authentication documentation
leportella a9f7057
Change name from second_factor to two_factor
leportella ab8b16e
Fix errors on nativeauth default variables
leportella feb5f0e
Add option to allow users to have a 2fa
leportella e8c47ed
Add authenticator input on login website
leportella 458bf45
Makind 2fa not allowed by default
leportella 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ pytest >= 3.7 | |
pytest-asyncio | ||
notebook==5.7.2 | ||
bcrypt | ||
onetimepass |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,46 @@ | ||
{% extends "page.html" %} | ||
{% block main %} | ||
|
||
|
||
<div class="container"> | ||
|
||
<div class="container"> | ||
<h1>Authorization Area</h1> | ||
|
||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Username</th> | ||
{% if ask_email %} | ||
<th>Email</th> | ||
{% endif %} | ||
<th>Is Authorized?</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for user in users %} | ||
{% if user.is_authorized %} | ||
<tr class="success"> | ||
<td>{{ user.username }}</td> | ||
{% if ask_email %} | ||
<td>{{ user.email }}</td> | ||
{% endif %} | ||
<td>Yes</td> | ||
<td> | ||
<a class="btn btn-default" | ||
href="/hub/authorize/{{ user.username }}" | ||
role="button">Unauthorize</a> | ||
</td> | ||
{% else %} | ||
<tr> | ||
<td>{{ user.username }}</td> | ||
{% if ask_email %} | ||
<td>{{ user.email }}</td> | ||
{% endif %} | ||
<td>No</td> | ||
<td> | ||
<a class="btn btn-jupyter" | ||
href="/hub/authorize/{{ user.username }}" | ||
role="button">Authorize</a> | ||
</td> | ||
{% endif %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
<thead> | ||
<tr> | ||
<th>Username</th> | ||
{% if ask_email %} | ||
<th>Email</th> | ||
{% endif %} | ||
<th>Has 2fa?</th> | ||
<th>Is Authorized?</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for user in users %} | ||
{% if user.is_authorized %} | ||
<tr class="success"> | ||
<td>{{ user.username }}</td> | ||
{% if ask_email %} | ||
<td>{{ user.email }}</td> | ||
{% endif %} | ||
<td>{{ user.has_2fa }}</td> | ||
<td>Yes</td> | ||
<td> | ||
<a class="btn btn-default" href="/hub/authorize/{{ user.username }}" role="button">Unauthorize</a> | ||
</td> | ||
{% else %} | ||
<tr> | ||
<td>{{ user.username }}</td> | ||
{% if ask_email %} | ||
<td>{{ user.email }}</td> | ||
{% endif %} | ||
<td>{{ user.has_2fa }}</td> | ||
<td>No</td> | ||
<td> | ||
<a class="btn btn-jupyter" href="/hub/authorize/{{ user.username }}" role="button">Authorize</a> | ||
</td> | ||
{% endif %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
|
||
{% endblock %} | ||
</div> | ||
{% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
{% endif %} | ||
<label for="username_input">Username:</label> | ||
<input id="username_input" type="text" autocapitalize="off" autocorrect="off" class="form-control" name="username" val="{{username}}" tabindex="1" autofocus="autofocus" /> | ||
<p></p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the empty ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A hack in the design the give more space between things 😅 I can take it off |
||
<label for='password_input'>Password:</label> | ||
<div class="input-group"> | ||
<input type="password" class="form-control" name="password" id="password_input" tabindex="2" /> | ||
|
@@ -42,9 +43,14 @@ | |
</button> | ||
</span> | ||
</div> | ||
{% if two_factor_auth %} | ||
<p></p> | ||
<label for="2fa_input">Two Factor Authentication:</label> | ||
<input id="2fa_input" type="text" autocapitalize="off" autocorrect="off" class="form-control" name="2fa" tabindex="1" autofocus="autofocus" placeholder="If you don't have 2FA, leave empty" /> | ||
{% endif %} | ||
<input type="submit" id="login_submit" class='btn btn-jupyter' value='Sign In' tabindex="3" /> | ||
<div style="padding-top: 25px;"> | ||
Don't have an user? <a href="/signup">Signup!</a> | ||
<p>Don't have an user? <a href="/signup">Signup!</a></p> | ||
</div> | ||
</div> | ||
</form> | ||
|
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
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.
What does the '10' refer to here?
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.
the token is created with size 10, so I limited here