-
Notifications
You must be signed in to change notification settings - Fork 1.1k
User authentication using OpenID Connect protocol #4474
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
Merged
Merged
Changes from all commits
Commits
Show all changes
165 commits
Select commit
Hold shift + click to select a range
f88c8c3
OAuth2.0 initial commit.
VJalili b593368
Added a sample config file and its related parser and setup.
VJalili 6aa59d1
Added UserOAuth2 class to model, and defined a table in mappings.
VJalili fbb28b9
Formatting ... added an empty line between two classes.
VJalili a9ea8d5
(1) added provider to the OAuth2.0 model, (2) changed endpoints,
VJalili a66bf82
Add migrate script for the OAuth2 table.
VJalili 432b551
Add sample OAuth2.0 configuration file, and updated its parser.
VJalili 3a90758
Change endpoint: `OAuth2Authenticate`-> `OAuth2Authentication`
VJalili 57f5a5f
Update OAuth2.0 controller.
VJalili a8705f9
Migration: Removed `nullable` restriction from 3 OAuth2.0 columns.
VJalili 5f55f56
Change `user` to `user_id`, & set some args optional on UserAuth2 init
VJalili 41cc0dc
Remove nullable restriction from some fields of galaxy_user_oauth2 table
VJalili d355108
Controller now attempts re-authentication upon False reply from callback
VJalili 2e4e28e
Add an interface for IdPs, & separated Google-specific flow from pare…
VJalili c027e31
Change OAuth2.0 endpoints to lower-case (was camel)
VJalili 2326add
Add a `TODO` comment.
VJalili 7ba12a1
Fix a bug; callback does not need to pass the provider name
VJalili 7c0cc5e
Fix bugs; no need to `commit`, access_token accessor change, and add …
VJalili 9dc0403
rename access_token to access_token_info
VJalili 734a005
make sample OAuth2.0 endpoint lowercase, and updated a comment.
VJalili 64d1cd8
Remove a `TODO` on Google callback check.
VJalili 1481603
Updated a log message.
VJalili 7ae287d
Added package requirements
VJalili f622206
Removed white spaces between parenthesis and arguments.
VJalili bd2c30b
Rebased and merged conflicts.
VJalili e0199f2
Merge remote-tracking branch 'origin/oauth2-after-rebase' into oauth2…
VJalili 0e55897
Changed migrated code sequence number.
VJalili 3714a92
Removed white space between parenthesis and arguments.
VJalili 875a79a
Few more white space removal.
VJalili 9087deb
Some formatting updates, and one additional endpoint removal
VJalili fe41dcb
An alpha version of authentication based on PSA.
VJalili df2cf94
Removed unused PSA storage file.
VJalili 6f50966
Replaced custom BaseStrategy with PSA Core BaseStrategy.
VJalili 18c0130
First efforts in replacing the PSA user with the Galaxy user.
VJalili 80718cd
Deleted PSAUsers class and mapping.
VJalili f2150af
Updates to Galaxy-user and PSA social incorporation.
VJalili 4829f2d
Renamed `galaxy_user_oauth2` table to 'oidc_rp'
VJalili 55c0b4b
extended `social_auth_usersocialauth` table.
VJalili 8148375
Renamed user authnz table and model.
VJalili 9205cf2
Added two methods to return id and access tokens, & updated a comment.
VJalili 5d8b8e1
Implemented disconnect endpoint, & updated some comments.
VJalili e6bb39d
Updated the disconnect process, & added some comments.
VJalili 6734638
Updated flush function.
VJalili bef0ad9
Enabled authenticating an anonymous user.
VJalili 071e174
Updated the temporary user password to a random string.
VJalili 9c3ec35
Fixed a bug: cannot disconnect anonymous users.
VJalili ed0d2d4
Resolved a bug: cannot disconnect if not already authenticated.
VJalili 3352c3e
Simplified UserAuthnzToken class by flattening unnecessary indirections.
VJalili 6238849
Explained the key-value pairs of a static property.
VJalili 88dc7e3
Removed some comments and implemented Nonce class.
VJalili 7c1a846
Simplified Nonce class.
VJalili b8704f8
Refactored PSA Nonce table, & removed some unused imports.
VJalili cd6b934
Added missing `.table` in mapping.py for the PSA tables.
VJalili 04cb179
Implemented SocialAuthAssociation class.
VJalili 54f3033
Added some missing mappers of the PSA-related tables.
VJalili 1a10718
Implemented PSA partial class.
VJalili bd46767
Implemented PSA Code class.
VJalili 6f27d09
Some clean-ups in psa_authnz
VJalili d39c9c3
refactored PSA-related models and tables.
VJalili 3cb9fd0
Removed a solved todo comment.
VJalili 98e8408
Removed unused parameter provider from PSAAuthnz initialization.
VJalili 61bbdde
Made some IdP-specific settings dynamic.
VJalili e290fea
Redirect user to main page after a successful authentication.
VJalili 8eba74c
Added on-the-fly-config function.
VJalili 98d5910
Login an anonymous user after a successful authn with an IdP.
VJalili 2c77032
Commented a configuration key.
VJalili 5f7206a
disabled consent prompt for Google authn.
VJalili ae0e173
Made `prompt` a variable defined in and read from configuration.
VJalili 35482fd
Added PSA-level configuration (i.e., applied to all backends).
VJalili 55362e4
Added `oidc_rp_config.xml.sample` file.
VJalili b3c1f3c
Capture errors on authnz callback.
VJalili dec858f
Added disconnect redirect URL to disconnect function signature.
VJalili 55cb550
Updated OAuth2.0 configuration sample file.
VJalili 54374ae
Some refactoring.
VJalili 9151c0d
Added a description for the attribute-value pairs of OIDC config file.
VJalili 3104ae1
updated redirect uri, now it is read from config.
VJalili bdb2c3e
Switched strategy and backend to local variables.
VJalili ba5312f
Replaced multiple local backend name variables, with a static dict.
VJalili 40609a8
Removed the temporary global variable _trans.
VJalili 0d0493e
Removed the temporary global variable _user.
VJalili 4674670
Replaced local url variable with a config key.
VJalili 2e0e049
Re-arch: parse all config at init time, and create backends on the fly.
VJalili 8d6669f
Removed unused configuration in user login function, and saved the info
VJalili d5a295b
Fixed a typo.
VJalili 60d2794
Refactored backend and strategy variables scope in callback to be local.
VJalili ed77f12
Extended the signature of login_user function.
VJalili 7249a1c
Updated get_current_user function to rely only on Galaxy Trans.
VJalili a1b9842
Made dynamic the backend name part of a state token config key.
VJalili 794746e
Removed an unused trans assignment.
VJalili e168eaf
A line break.
VJalili 009248b
Replaced a temporary redirect URI assignment with a config kvp.
VJalili d2ad569
Refactored the scope of strategy & backend variables of disconnect func.
VJalili 0623793
Removed an unused trans variable assignment in disconnect function.
VJalili 0663e57
Now authnz callback receives login_redirect_url from controller.
VJalili e9ba0b9
Refactored disconnect redirect url.
VJalili aa07653
Some updates to config parameters.
VJalili ba05d28
Changed the scope of config variable.
VJalili 33f2a8f
Fixed a bug with disconnect redirect url.
VJalili ab130f7
Updated the build_absolute_uri function of the Strategy.
VJalili cb4645f
Some cleanup.
VJalili cd9783e
Removed the unused function `create_user`.
VJalili b086802
Now get IdP names from buildapp/router; previously it was hard-code.
VJalili 10e8053
Added some authnz front-end components.
VJalili c05c3c1
Merge remote-tracking branch 'remotes/upstream/dev' into psaAlpha
VJalili 0b12196
Incremented migration scripts number.
VJalili ba18313
Fixed some bugs: some imports were removed as a result of last merge.
VJalili 74b27d2
Extended login, callback, and disconnect functions to return success,…
VJalili 294bdf4
Updated a dictionary init/update to dict literal values.
VJalili b4bdfe5
Refactored internal functions of Authn to adhere with private methods…
VJalili 969a2e4
Updated disconnect function to return `success`, `message` & `response`.
VJalili 6935adc
Removed the non-PSA-based authnz code.
VJalili 7552952
Moved AuthnzManager to another module than init to avoid cyclic imports.
VJalili 0b3b756
Removed temporary class User, and temporary models module.
VJalili 22b4859
Fixed a typo.
VJalili 3ae1552
Added the "Login with Google" button.
VJalili a17d8dd
Fixed a bug redirecting after successfully handling a call-back.
VJalili 8385954
Capture callback errors, and inform the user and log the error.
VJalili 2165447
Updated callback error handling.
VJalili be1acdc
Fixed a bug capturing some errors raised when handling authnz callbacks.
VJalili 0c85d90
Some refactoring and updates to authnz error/exception handling.
VJalili bc854b0
Add dependencies required for a PSA-based Authnz.
VJalili 596ef27
Merge remote-tracking branch 'upstream/dev' into oauth2-after-rebase
VJalili 1e8e60a
Merge remote-tracking branch 'upstream/dev' into psaAlpha
VJalili 3afc67d
Merge branch 'oauth2-after-rebase' into psaAlpha
VJalili cd92485
Merge pull request #4 from VJalili/psaAlpha
VJalili 1502e0d
Remove OAuth2.0 migration script, & update OIDC migration script number.
VJalili d85c354
Remove old OAuth2.0 configuration file.
VJalili f06d793
Add missing oidc_backends_config.xml.sample.
VJalili b88339e
obfuscate client id and secret in oidc backend config sample.
VJalili 2a6f6e1
Add a sample of redirect URL to oidc_backends_config.xml.sample.
VJalili 0f4ec2f
Fix a line indentation issue.
VJalili cab0b48
Set optional parameter username as last argument of `User` constructor.
VJalili 8980e82
Check for missing `enable_oidc` in login mako.
VJalili 26c91f2
Remove unused OAuth2 controller.
VJalili 218b88e
Remove the unused google oidc implementation.
VJalili 4e7b39e
Some sorts on imports and adding new lines.
VJalili b951bb2
Some ordering to imports; remove `socket` & `codecs` imports.
VJalili 3c4ceb0
Replaced `unicode` with `str`.
VJalili a992d1f
Update a comment.
VJalili d1ac819
cross-python 2/3 assertion if object is of string type.
VJalili c7ab4e2
Fix a bug with disconnect.
VJalili 362cfca
Remove additional new line.
VJalili 68acf98
Fixed a bug re-associating a disconnected OIDC identity with a user.
VJalili 2f479e1
Merge remote-tracking branch 'upstream/dev' into oauth2-after-rebase
VJalili 181d86f
Add OIDC configuration to the new galaxy.yml.sample file.
VJalili 5c13e50
Set PSA to persist ID and refresh tokens.
VJalili ba3eaec
Update PSA setting to persist `id_token`.
VJalili 6ea87b5
Merge branch 'dev' into oauth2-after-rebase
VJalili 654206e
Add OIDC and OAuth2.0 pinned requirements to `requirements.txt`.
VJalili 6dcdcc4
When OIDC is not enabled and user manually reaches its endpoint,
VJalili 730b931
OIDC config in galaxy.yml.sample is now set via config_schema.
VJalili ea0ebd8
Replace static redirect and username with proper variables.
VJalili f634c40
Merge remote-tracking branch 'upstream/dev' into oauth2-after-rebase
VJalili 320cf47
Encrypt random password of a user who is logged-in using OIDC.
VJalili 6b998e6
Add a missing blank line at the end of OIDC config samples.
VJalili 60e936c
Add a comment to OIDC config explaining the unit of settings.
VJalili 5ffaf9f
use `random.sample` to generate random password for a user.
VJalili 259daf1
Merge remote-tracking branch 'upstream/dev' into oauth2-after-rebase
VJalili 86e13a5
Add OIDC requirements to pipfiles/default/pinned-requirements.txt
VJalili 1263161
Remove changes to pinned-requirements.txt
VJalili 7f1e07b
Add PSA requirement to pipfile and run `make update-dependencies`.
VJalili cd7e0b1
Merge remote-tracking branch 'upstream/dev' into oauth2-after-rebase
VJalili 1ed2b8f
replaced pinned-requirements file with s symlink.
VJalili 00d48f0
Add the missing pyjwkest requirement to pipfile.
VJalili d01be5d
Create `set_random_password` function in galaxy user.
VJalili 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 hidden or 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 hidden or 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 @@ | ||
<?xml version="1.0"?> | ||
<OIDC> | ||
<provider name="Google"> | ||
<client_id> ... </client_id> | ||
<client_secret> ... </client_secret> | ||
<redirect_uri>http://localhost:8080/authnz/google/callback</redirect_uri> | ||
|
||
<!-- <prompt>select_account</prompt> --> | ||
<!--The value of this parameter (i.e., prompt) specifies whether the Google authorization server should prompt | ||
a galaxy user for (re)authorization and consent. The possible values are: `none`, `consent`, and | ||
`select_account`. HOWEVER, DO NOT USE `none`, because it will cause authentication failure for new users. | ||
see the following page for more information: | ||
https://developers.google.com/identity/protocols/OpenIDConnect#prompt | ||
|
||
If you want the consent screen to be shown to the new users only, and re-authorization happen without | ||
asking for user's consent, then remove this attribute. | ||
--> | ||
</provider> | ||
</OIDC> |
This file contains hidden or 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,21 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
Each Setter must have three attributes: Property, Value, and Type. | ||
|
||
- Property: sets the name of a Python Social Auth (PSA) configuration attribute that its value is set by the setter. | ||
|
||
- Value: sets a value for the property. | ||
|
||
- Type: sets the type of the value. Galaxy uses the specified type to cast the values of string type to their actual | ||
type. For instance, casts "False" -> False (string -> boolean). The value of the `Type` attribute should be a Python | ||
built-in type, which could be any of the following types: int; long; float; str; tuple; list; and dict. | ||
|
||
Note that the values of these attributes are case-sensitive. | ||
--> | ||
<OIDC> | ||
<Setter Property="VERIFY_SSL" Value="False" Type="bool"/> | ||
<Setter Property="REQUESTS_TIMEOUT" Value="3600" Type="float"/> | ||
<!-- The unit of value is seconds --> | ||
<Setter Property="ID_TOKEN_MAX_AGE" Value="3600" Type="float"/> | ||
<!-- The unit of value is seconds --> | ||
</OIDC> |
This file contains hidden or 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 hidden or 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 hidden or 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,68 @@ | ||
""" | ||
Contains implementations for authentication and authorization against an | ||
OpenID Connect (OIDC) Identity Provider (IdP). | ||
|
||
This package follows "authorization code flow" authentication protocol to authenticate | ||
Galaxy users against third-party identity providers. | ||
|
||
Additionally, this package implements functionalist's to request temporary access | ||
credentials for cloud-based resource providers (e.g., Amazon AWS, Microsoft Azure). | ||
""" | ||
|
||
|
||
class IdentityProvider(object): | ||
""" | ||
OpenID Connect Identity Provider abstract interface. | ||
""" | ||
|
||
def __init__(self, provider, config): | ||
""" | ||
Initialize the identity provider using the provided configuration, | ||
and raise a ParseError (or any more related specific exception) in | ||
case the configuration is malformed. | ||
|
||
:type provider: string | ||
:param provider: is the name of the identity provider (e.g., Google). | ||
|
||
:type config: xml.etree.ElementTree.Element | ||
:param config: Is the configuration element of the provider | ||
from the configuration file (e.g., oidc_config.xml). | ||
This element contains the all the provider-specific | ||
configuration elements. | ||
""" | ||
raise NotImplementedError() | ||
|
||
def authenticate(self, provider, trans): | ||
"""Runs for authentication process. Checks the database if a | ||
valid identity exists in the database; if yes, then the user | ||
is authenticated, if not, it generates a provider-specific | ||
authentication flow and returns redirect URI to the controller. | ||
|
||
:type trans: GalaxyWebTransaction | ||
:param trans: Galaxy web transaction. | ||
|
||
:return: a redirect URI to the provider's authentication | ||
endpoint. | ||
""" | ||
raise NotImplementedError() | ||
|
||
def callback(self, state_token, authz_code, trans, login_redirect_url): | ||
""" | ||
Handles authentication call-backs from identity providers. | ||
This process maps `state-token` to a user | ||
:type state_token: string | ||
:param state_token: is an anti-forgery token which identifies | ||
a Galaxy user to whom the given authorization code belongs to. | ||
:type authz_code: string | ||
:param authz_code: a very short-lived, single-use token to | ||
request a refresh token. | ||
:type trans: GalaxyWebTransaction | ||
:param trans: Galaxy web transaction. | ||
:return boolean: | ||
True: if callback is handled successfully. | ||
False: if processing callback fails, then Galaxy attempts re-authentication. | ||
""" | ||
raise NotImplementedError() | ||
|
||
def disconnect(self, provider, trans, disconnect_redirect_url=None): | ||
raise NotImplementedError() |
This file contains hidden or 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,145 @@ | ||
|
||
import importlib | ||
import logging | ||
import xml.etree.ElementTree as ET | ||
from xml.etree.ElementTree import ParseError | ||
|
||
from .psa_authnz import PSAAuthnz | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
class AuthnzManager(object): | ||
|
||
def __init__(self, app, oidc_config_file, oidc_backends_config_file): | ||
""" | ||
:type app: galaxy.app.UniverseApplication | ||
:param app: | ||
|
||
:type config: string | ||
:param config: sets the path for OIDC configuration | ||
file (e.g., oidc_backends_config.xml). | ||
""" | ||
self._parse_oidc_config(oidc_config_file) | ||
self._parse_oidc_backends_config(oidc_backends_config_file) | ||
|
||
def _parse_oidc_config(self, config_file): | ||
self.oidc_config = {} | ||
try: | ||
tree = ET.parse(config_file) | ||
root = tree.getroot() | ||
if root.tag != 'OIDC': | ||
raise ParseError("The root element in OIDC_Config xml file is expected to be `OIDC`, " | ||
"found `{}` instead -- unable to continue.".format(root.tag)) | ||
for child in root: | ||
if child.tag != 'Setter': | ||
log.error("Expect a node with `Setter` tag, found a node with `{}` tag instead; " | ||
"skipping this node.".format(child.tag)) | ||
continue | ||
if 'Property' not in child.attrib or 'Value' not in child.attrib or 'Type' not in child.attrib: | ||
log.error("Could not find the node attributes `Property` and/or `Value` and/or `Type`;" | ||
" found these attributes: `{}`; skipping this node.".format(child.attrib)) | ||
continue | ||
try: | ||
func = getattr(importlib.import_module('__builtin__'), child.get('Type')) | ||
except AttributeError: | ||
log.error("The value of attribute `Type`, `{}`, is not a valid built-in type;" | ||
" skipping this node").format(child.get('Type')) | ||
continue | ||
self.oidc_config[child.get('Property')] = func(child.get('Value')) | ||
except ImportError: | ||
raise | ||
except ParseError as e: | ||
raise ParseError("Invalid configuration at `{}`: {} -- unable to continue.".format(config_file, e.message)) | ||
|
||
def _parse_oidc_backends_config(self, config_file): | ||
self.oidc_backends_config = {} | ||
try: | ||
tree = ET.parse(config_file) | ||
root = tree.getroot() | ||
if root.tag != 'OIDC': | ||
raise ParseError("The root element in OIDC config xml file is expected to be `OIDC`, " | ||
"found `{}` instead -- unable to continue.".format(root.tag)) | ||
for child in root: | ||
if child.tag != 'provider': | ||
log.error("Expect a node with `provider` tag, found a node with `{}` tag instead; " | ||
"skipping the node.".format(child.tag)) | ||
continue | ||
if 'name' not in child.attrib: | ||
log.error("Could not find a node attribute 'name'; skipping the node '{}'.".format(child.tag)) | ||
continue | ||
idp = child.get('name').lower() | ||
if idp == 'google': | ||
self.oidc_backends_config[idp] = self._parse_google_config(child) | ||
if len(self.oidc_backends_config) == 0: | ||
raise ParseError("No valid provider configuration parsed.") | ||
except ImportError: | ||
raise | ||
except ParseError as e: | ||
raise ParseError("Invalid configuration at `{}`: {} -- unable to continue.".format(config_file, e.message)) | ||
# except Exception as e: | ||
# raise Exception("Malformed OIDC Configuration XML -- unable to continue. {}".format(e.message)) | ||
|
||
def _parse_google_config(self, config_xml): | ||
rtv = { | ||
'client_id': config_xml.find('client_id').text, | ||
'client_secret': config_xml.find('client_secret').text, | ||
'redirect_uri': config_xml.find('redirect_uri').text} | ||
if config_xml.find('prompt') is not None: | ||
rtv['prompt'] = config_xml.find('prompt').text | ||
return rtv | ||
|
||
def _get_authnz_backend(self, provider): | ||
provider = provider.lower() | ||
if provider in self.oidc_backends_config: | ||
try: | ||
return True, "", PSAAuthnz(provider, self.oidc_config, self.oidc_backends_config[provider]) | ||
except Exception as e: | ||
log.exception('An error occurred when loading PSAAuthnz: ', str(e)) | ||
return False, str(e), None | ||
else: | ||
msg = 'The requested identity provider, `{}`, is not a recognized/expected provider'.format(provider) | ||
log.debug(msg) | ||
return False, msg, None | ||
|
||
def authenticate(self, provider, trans): | ||
""" | ||
:type provider: string | ||
:param provider: set the name of the identity provider to be | ||
used for authentication flow. | ||
:type trans: GalaxyWebTransaction | ||
:param trans: Galaxy web transaction. | ||
:return: an identity provider specific authentication redirect URI. | ||
""" | ||
try: | ||
success, message, backend = self._get_authnz_backend(provider) | ||
if success is False: | ||
return False, message, None | ||
return True, "Redirecting to the `{}` identity provider for authentication".format(provider), backend.authenticate(trans) | ||
except Exception as e: | ||
msg = 'An error occurred when authenticating a user on `{}` identity provider: {}'.format(provider, str(e)) | ||
log.exception(msg) | ||
return False, msg, None | ||
|
||
def callback(self, provider, state_token, authz_code, trans, login_redirect_url): | ||
try: | ||
success, message, backend = self._get_authnz_backend(provider) | ||
if success is False: | ||
return False, message, (None, None) | ||
return True, message, backend.callback(state_token, authz_code, trans, login_redirect_url) | ||
except Exception as e: | ||
msg = 'An error occurred when handling callback from `{}` identity provider; {}'.format(provider, str(e)) | ||
log.exception(msg) | ||
return False, msg, (None, None) | ||
|
||
def disconnect(self, provider, trans, disconnect_redirect_url=None): | ||
try: | ||
success, message, backend = self._get_authnz_backend(provider) | ||
if success is False: | ||
return False, message, None | ||
return backend.disconnect(provider, trans, disconnect_redirect_url) | ||
except Exception as e: | ||
msg = 'An error occurred when disconnecting authentication with `{}` identity provider for user `{}`; ' \ | ||
'{}'.format(provider, trans.user.username, str(e)) | ||
log.exception(msg) | ||
return False, msg, None |
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.
Was there a reason to create this folder as separate from other auth stuff? Otherwise I think it would make more sense to have with the rest of the pluggable auth, under
galaxy/lib/galaxy/auth/providers/
, or even aoauth2
subdirectory under providers.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.
Though their logic might sound similar to some degree, but they have their own flow, constructors, managers, and backends (providers) which do not necessarily overlap with each other. Hence IMHO merging these two might be counter-intuitive.