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
OAuth Browsable API Login #188
Open
jhazentia
wants to merge
33
commits into
master
Choose a base branch
from
oauth-login
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
5f8e3ae
Added Browsable API login using OAuth
jhazentia 837206d
add OAUTH_AUTHORIZATION_URL
jhazentia 9efb757
updated test fixtures, oauth session tests
jhazentia 6aae328
add authorization flow test
jhazentia 05ad1d6
cleanup
jhazentia 7d900e5
dynamic base template log in link
jhazentia 5c3dde7
Added oauth session tests
jhazentia 82254d9
cleanup and fix logout, templates
jhazentia 27d2a37
Merge 'master' into oauth-login
jhazentia 67fa3b1
fix formatting
jhazentia 9f6baf0
update static files
jhazentia d704b40
fix api template, session settings
jhazentia b9e4b2c
store email from token; improve tests, logging, settings
jhazentia 2829c2e
delete token if authentication fails, remove log message
jhazentia 168764f
verify oauth callback request origin
jhazentia c69dffb
test oauth callback origin check, skip check for mock sensor
jhazentia b6aec25
remove empty file
jhazentia 594580f
remove commented out code
jhazentia 3acaa7e
remove commented out code
jhazentia 0b5c5d0
new test client for oauth, new tests, check uid, remove oauth callbac…
jhazentia 0f5454b
nginx config add client cert dn
jhazentia 5fd832a
removed certs, updated readme, tests create temp certs, improved tests
jhazentia 1d51792
Updated README security information
jhazentia 6792496
consolidated readme security section, misc readme improvements
jhazentia 3180f8a
update nginx version, small readme updates
jhazentia bb8f57e
Updated documentation, fixed client id check
jhazentia 08ac37d
update README
jhazentia 3871fed
Merge branch 'master' of https://github.com/NTIA/scos-sensor into oau…
jhazentia 2079f0d
cleanup conftest from merge
jhazentia 3bc0efd
uncomment scos-actions in requirements
jhazentia c71cfd9
fix uid parse, update readme, add exception, fix env.template file names
jhazentia 1cb7af4
enable same-origin referrer headers for csrf
jhazentia 2f536a7
fix formatting
jhazentia File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.conf import settings | ||
from django.contrib.auth import views | ||
from django.urls import path | ||
|
||
from authentication.views import oauth_login_callback, oauth_login_view | ||
|
||
urlpatterns = ( | ||
path("oauth2/", oauth_login_view, name="oauth-login"), | ||
path(f"oauth2/code/{settings.FQDN}", oauth_login_callback, name="oauth-callback"), | ||
# https://github.com/encode/django-rest-framework/blob/master/rest_framework/urls.py | ||
path("oauth2/logout/", views.LogoutView.as_view(), name="oauth-logout"), | ||
) |
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
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.
Can you not just use socket.getfqdn(). Will that not work in Docker?
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.
Not able to get the right value in docker