This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ability to use openid-connect flow for other providers
- Loading branch information
1 parent
578432d
commit 25ae598
Showing
13 changed files
with
191 additions
and
157 deletions.
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
include setup.py package.json webpack.config.js README.rst MANIFEST.in LICENSE AUTHORS | ||
recursive-include sentry_auth_google/templates * | ||
recursive-include sentry_auth_openid_connect/templates * | ||
global-exclude *~ |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
from __future__ import absolute_import | ||
|
||
from sentry.auth import register | ||
|
||
from .provider import OpenIDConnectOAuth2Provider | ||
|
||
register('openid_connect', OpenIDConnectOAuth2Provider) |
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,33 @@ | ||
from __future__ import absolute_import, print_function | ||
|
||
from django.conf import settings | ||
|
||
|
||
AUTHORIZE_URL = getattr(settings, 'OPENID_CONNECT_AUTHORIZATION_ENDPOINT', | ||
'https://accounts.google.com/o/oauth2/v2/auth') | ||
|
||
ACCESS_TOKEN_URL = getattr(settings, 'OPENID_CONNECT_TOKEN_ENDPOINT', | ||
'https://www.googleapis.com/oauth2/v4/token') | ||
|
||
CLIENT_ID = getattr(settings, 'OPENID_CONNECT_CLIENT_ID', None) | ||
if not CLIENT_ID: | ||
"""Try Google backwards compability""" | ||
CLIENT_ID = getattr(settings, 'GOOGLE_CLIENT_ID', None) | ||
|
||
CLIENT_SECRET = getattr(settings, 'OPENID_CONNECT_CLIENT_SECRET', None) | ||
if not CLIENT_SECRET: | ||
"""Try Google backwards compability""" | ||
CLIENT_SECRET = getattr(settings, 'GOOGLE_CLIENT_SECRET', None) | ||
|
||
API_URL = getattr(settings, 'OPENID_CONNECT_USERINFO_ENDPOINT', | ||
'https://www.googleapis.com/oauth2/v3/userinfo') | ||
|
||
SCOPE = getattr(settings, 'OPENID_CONNECT_SCOPE', 'openid email') | ||
|
||
PROVIDER_NAME = getattr(settings, 'OPENID_CONNECT_PROVIDER_NAME', 'Google') | ||
|
||
ERR_INVALID_DOMAIN = 'The domain for your account (%s) is not allowed to authenticate with this provider.' | ||
|
||
ERR_INVALID_RESPONSE = 'Unable to fetch user information from Provider. Please check the log.' | ||
|
||
DATA_VERSION = '1' |
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
2 changes: 1 addition & 1 deletion
2
...mplates/sentry_auth_google/configure.html → ...sentry_auth_openid_connect/configure.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<h3>Domain</h3> | ||
|
||
<p>Users will be allowed to authenticate if they have an account under the Google Apps domain <strong>{{ domains|join:" or " }}</strong>.</p> | ||
<p>Users will be allowed to authenticate if they have an account under the domain <strong>{{ domains|join:" or " }}</strong>.</p> |
File renamed without changes.
Oops, something went wrong.