From 470aa83d474d798e78b1361ccf48935b2696c6f5 Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Sat, 9 Mar 2019 02:27:23 +0100 Subject: [PATCH 01/12] Add support for Okta OIDC authentication. This is dependent on https://github.com/python-social-auth/social-core/pull/333. --- .../galaxy/scripts/components/login/Login.vue | 13 +++++---- config/oidc_backends_config.xml.sample | 11 ++++++++ lib/galaxy/authnz/managers.py | 22 +++++++++++++-- lib/galaxy/authnz/psa_authnz.py | 27 +++++++++++++++---- lib/galaxy/config.py | 1 + .../pipfiles/default/pinned-requirements.txt | 2 +- lib/galaxy/managers/configuration.py | 1 + 7 files changed, 64 insertions(+), 13 deletions(-) diff --git a/client/galaxy/scripts/components/login/Login.vue b/client/galaxy/scripts/components/login/Login.vue index fc7d84f9c2f..79d96c59f01 100644 --- a/client/galaxy/scripts/components/login/Login.vue +++ b/client/galaxy/scripts/components/login/Login.vue @@ -24,8 +24,8 @@ - - Sign in with Google + + Sign in with {{ idp.charAt(0).toUpperCase() + idp.slice(1) }}
@@ -56,6 +56,7 @@ export default { }, data() { let galaxy = getGalaxyInstance(); + let oidc_idps = Object.keys(galaxy.config.oidc).filter(function(key) { return galaxy.config.oidc[key]; }); return { login: null, password: null, @@ -65,7 +66,9 @@ export default { messageVariant: null, redirect: galaxy.params.redirect, session_csrf_token: galaxy.session_csrf_token, - enable_oidc: galaxy.config.enable_oidc + enable_oidc: galaxy.config.enable_oidc, + oidc_idps: oidc_idps, + oidc_idps_icons_class: {'google': 'fa fa-google', 'okta': 'fa fa-circle-o'} }; }, computed: { @@ -101,10 +104,10 @@ export default { this.messageText = message || "Login failed for an unknown reason."; }); }, - submitOIDCLogin: function(method) { + submitOIDCLogin: function(idp) { let rootUrl = getAppRoot(); axios - .post(`${rootUrl}authnz/google/login`) + .post(`${rootUrl}authnz/${idp}/login`) .then(response => { if (response.data.redirect_uri) { window.location = encodeURI(response.data.redirect_uri); diff --git a/config/oidc_backends_config.xml.sample b/config/oidc_backends_config.xml.sample index eee3c02daf2..4a99bbb7b16 100644 --- a/config/oidc_backends_config.xml.sample +++ b/config/oidc_backends_config.xml.sample @@ -22,4 +22,15 @@ login to Galaxy using their Google account. --> + + ... + ... + http://localhost:8080/authnz/okta/callback + + https://dev-000000.oktapreview.com/oauth2/default + + diff --git a/lib/galaxy/authnz/managers.py b/lib/galaxy/authnz/managers.py index d855387d074..076e3851f92 100644 --- a/lib/galaxy/authnz/managers.py +++ b/lib/galaxy/authnz/managers.py @@ -39,6 +39,7 @@ class AuthnzManager(object): :param config: sets the path for OIDC configuration file (e.g., oidc_backends_config.xml). """ + self.app = app self._parse_oidc_config(oidc_config_file) self._parse_oidc_backends_config(oidc_backends_config_file) @@ -88,8 +89,15 @@ class AuthnzManager(object): 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) + + idp_provider = { + "google": self._parse_google_config, + "okta": self._parse_okta_config + } + if idp in idp_provider: + self.oidc_backends_config[idp] = idp_provider[idp](child) + self.app.config.oidc[idp] = True + if len(self.oidc_backends_config) == 0: raise ParseError("No valid provider configuration parsed.") except ImportError: @@ -106,6 +114,16 @@ class AuthnzManager(object): rtv['prompt'] = config_xml.find('prompt').text return rtv + def _parse_okta_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, + 'api_url': config_xml.find('api_url').text} + if config_xml.find('prompt') is not None: + rtv['prompt'] = config_xml.find('prompt').text + return rtv + def _unify_provider_name(self, provider): if provider.lower() in self.oidc_backends_config: return provider.lower() diff --git a/lib/galaxy/authnz/psa_authnz.py b/lib/galaxy/authnz/psa_authnz.py index c4448ec3b27..ea768983c24 100644 --- a/lib/galaxy/authnz/psa_authnz.py +++ b/lib/galaxy/authnz/psa_authnz.py @@ -18,11 +18,13 @@ DEFAULTS = { } BACKENDS = { - 'google': 'social_core.backends.google_openidconnect.GoogleOpenIdConnect' + 'google': 'social_core.backends.google_openidconnect.GoogleOpenIdConnect', + 'okta': 'social_core.backends.okta.OktaOpenIdConnect' } BACKENDS_NAME = { - 'google': 'google-openidconnect' + 'google': 'google-openidconnect', + 'okta': 'okta-openidconnect' } AUTH_PIPELINE = ( @@ -96,8 +98,12 @@ class PSAAuthnz(IdentityProvider): # the just logged-in user. self.config[setting_name('INACTIVE_USER_LOGIN')] = True - if provider == 'google': - self._setup_google_backend(oidc_backend_config) + idp_provider = { + "google": self._setup_google_backend, + "okta": self._setup_okta_backend + } + if provider in idp_provider: + idp_provider[provider](oidc_backend_config) def _setup_google_backend(self, oidc_backend_config): self.config[setting_name('AUTH_EXTRA_ARGUMENTS')] = {'access_type': 'offline'} @@ -107,6 +113,15 @@ class PSAAuthnz(IdentityProvider): if oidc_backend_config.get('prompt') is not None: self.config[setting_name('AUTH_EXTRA_ARGUMENTS')]['prompt'] = oidc_backend_config.get('prompt') + def _setup_okta_backend(self, oidc_backend_config): + self.config[setting_name('AUTH_EXTRA_ARGUMENTS')] = {'access_type': 'offline'} + self.config['SOCIAL_AUTH_OKTA_OPENIDCONNECT_KEY'] = oidc_backend_config.get('client_id') + self.config['SOCIAL_AUTH_OKTA_OPENIDCONNECT_SECRET'] = oidc_backend_config.get('client_secret') + self.config['SOCIAL_AUTH_OKTA_OPENIDCONNECT_API_URL'] = oidc_backend_config.get('api_url') + self.config['redirect_uri'] = oidc_backend_config.get('redirect_uri') + if oidc_backend_config.get('prompt') is not None: + self.config[setting_name('AUTH_EXTRA_ARGUMENTS')]['prompt'] = oidc_backend_config.get('prompt') + def _get_helper(self, name, do_import=False): this_config = self.config.get(setting_name(name), DEFAULTS.get(name, None)) return do_import and module_member(this_config) or this_config @@ -160,7 +175,9 @@ class Strategy(BaseStrategy): self.session = session if session else {} self.config = config self.config['SOCIAL_AUTH_REDIRECT_IS_HTTPS'] = True if self.request and self.request.host.startswith('https:') else False - self.config['SOCIAL_AUTH_GOOGLE_OPENIDCONNECT_EXTRA_DATA'] = ['id_token'] + if self.config['provider'] == "google": + self.config['SOCIAL_AUTH_GOOGLE_OPENIDCONNECT_EXTRA_DATA'] = ['id_token'] + super(Strategy, self).__init__(storage, tpl) def get_setting(self, name): diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index c270443c37d..4818bd17c31 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -212,6 +212,7 @@ class Configuration(object): self.enable_oidc = kwargs.get("enable_oidc", False) self.oidc_config = kwargs.get("oidc_config_file", self.oidc_config_file) self.oidc_backends_config = kwargs.get("oidc_backends_config_file", self.oidc_backends_config_file) + self.oidc = {} # The value of migrated_tools_config is the file reserved for containing only those tools that have been eliminated from the distribution # and moved to the tool shed. self.integrated_tool_panel_config = resolve_path(kwargs.get('integrated_tool_panel_config', 'integrated_tool_panel.xml'), self.root) diff --git a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt index 59c0e44ab18..70204904082 100644 --- a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt @@ -139,7 +139,7 @@ routes==2.4.1 s3transfer==0.1.13 simplejson==3.16.0 six==1.11.0 -social-auth-core[openidconnect]==1.5.0 +social-auth-core[openidconnect]==3.1.0 sqlalchemy-migrate==0.12.0 sqlalchemy-utils==0.33.11 sqlalchemy==1.2.18 diff --git a/lib/galaxy/managers/configuration.py b/lib/galaxy/managers/configuration.py index bd3d7466183..7a5e70e9d69 100644 --- a/lib/galaxy/managers/configuration.py +++ b/lib/galaxy/managers/configuration.py @@ -63,6 +63,7 @@ class ConfigSerializer(base.ModelSerializer): 'allow_user_creation' : _defaults_to(False), 'use_remote_user' : _defaults_to(None), 'enable_oidc' : _defaults_to(False), + 'oidc' : _defaults_to(self.app.config.oidc), 'enable_quotas' : _defaults_to(False), 'remote_user_logout_href' : _defaults_to(''), 'datatypes_disable_auto' : _defaults_to(False), From 5f82d224174069b47aa951dc69cf9c223ca4fd48 Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Sat, 9 Mar 2019 02:31:22 +0100 Subject: [PATCH 02/12] Update documentation for Okta --- doc/source/admin/authentication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/admin/authentication.md b/doc/source/admin/authentication.md index bae80da8d92..bf43f79b982 100644 --- a/doc/source/admin/authentication.md +++ b/doc/source/admin/authentication.md @@ -18,7 +18,7 @@ If deploying Galaxy using the default authentication option, user activation can ## OIDC and OAuth2.0 Leveraging OpenID Connect (OIDC) protocol, we enable login to Galaxy without explicitly creating a Galaxy user. This feature is disabled by default. In short, to enable this feature, a Galaxy server admin has to take the following two steps: -1. Define the Galaxy instance on an OIDC identity provider. At the moment, we support Google. To set a Galaxy instance on Google, go to _credentials_ section at [developers console](https://console.developers.google.com/), and configure the instance. At the end, you'll receive _client ID_ and _client secret_ take a note of these two tokens. +1. Define the Galaxy instance on an OIDC identity provider. At the moment, we support Google and Okta. To set a Galaxy instance on Google, go to _credentials_ section at [developers console](https://console.developers.google.com/), and configure the instance. At the end, you'll receive _client ID_ and _client secret_ take a note of these two tokens. For Okta, create a new application in Okta, type _web_. At the end you should take note of the _client ID_ and _client secret_ tokens. 2. Configure Galaxy. In the `galaxy.yml` file enable the OIDC service using the `enable_oidc` key and set the two configuration files (i.e., `oidc_config_file` and `oidc_backends_config_file`), based on the IdP information. From aa732e581085874f17878c5a02136a47054333cc Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Sat, 9 Mar 2019 18:38:00 +0100 Subject: [PATCH 03/12] OIDC configuration, change dependencies --- lib/galaxy/dependencies/__init__.py | 3 +++ lib/galaxy/dependencies/conditional-requirements.txt | 3 +++ .../dependencies/pipfiles/default/pinned-requirements.txt | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/dependencies/__init__.py b/lib/galaxy/dependencies/__init__.py index 073cf67301e..5249bf0392d 100644 --- a/lib/galaxy/dependencies/__init__.py +++ b/lib/galaxy/dependencies/__init__.py @@ -146,6 +146,9 @@ class ConditionalDependencies(object): ('docker' in self.container_interface_types or 'docker_swarm' in self.container_interface_types)) + def check_social_auth_core(self): + return self.config.get("enable_oidc", False) + def optional(config_file=None): if not config_file: diff --git a/lib/galaxy/dependencies/conditional-requirements.txt b/lib/galaxy/dependencies/conditional-requirements.txt index b406a2e03e4..c99684eef9b 100644 --- a/lib/galaxy/dependencies/conditional-requirements.txt +++ b/lib/galaxy/dependencies/conditional-requirements.txt @@ -24,3 +24,6 @@ pykube==0.15.0 kamaki watchdog + +# OIDC dependencies +social-auth-core[openidconnect]==3.1.0 \ No newline at end of file diff --git a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt index 70204904082..c72da5b4cdc 100644 --- a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt @@ -139,7 +139,6 @@ routes==2.4.1 s3transfer==0.1.13 simplejson==3.16.0 six==1.11.0 -social-auth-core[openidconnect]==3.1.0 sqlalchemy-migrate==0.12.0 sqlalchemy-utils==0.33.11 sqlalchemy==1.2.18 From 4a5922139a129cb4f5f2ca0a01c739cdb3f2bd53 Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Tue, 12 Mar 2019 20:46:38 +0100 Subject: [PATCH 04/12] Updates for Okta IdP and general IdPs --- client/galaxy/scripts/components/login/Login.vue | 7 +++++++ lib/galaxy/authnz/managers.py | 9 +++++++++ lib/galaxy/authnz/psa_authnz.py | 6 +++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/client/galaxy/scripts/components/login/Login.vue b/client/galaxy/scripts/components/login/Login.vue index 79d96c59f01..3363b9e1538 100644 --- a/client/galaxy/scripts/components/login/Login.vue +++ b/client/galaxy/scripts/components/login/Login.vue @@ -57,6 +57,13 @@ export default { data() { let galaxy = getGalaxyInstance(); let oidc_idps = Object.keys(galaxy.config.oidc).filter(function(key) { return galaxy.config.oidc[key]; }); + // Icons to use for each IdP + let oidc_idps_icons = {'google': 'fa fa-google', 'okta': 'fa fa-circle-o'}; + // Add default icons to IdPs without icons + oidc_idps.filter(function(key) { return oidc_idps_icons[key] === undefined; }).forEach(function(idp) { + oidc_idps_icons[idp] = 'fa fa-id-card' + }); + return { login: null, password: null, diff --git a/lib/galaxy/authnz/managers.py b/lib/galaxy/authnz/managers.py index 08a8b09634e..f6b657e3c60 100644 --- a/lib/galaxy/authnz/managers.py +++ b/lib/galaxy/authnz/managers.py @@ -39,6 +39,7 @@ class AuthnzManager(object): :param config: sets the path for OIDC configuration file (e.g., oidc_backends_config.xml). """ + self.app = app self._parse_oidc_config(oidc_config_file) self._parse_oidc_backends_config(oidc_backends_config_file) @@ -90,6 +91,8 @@ class AuthnzManager(object): idp = child.get('name').lower() if idp in BACKENDS_NAME: self.oidc_backends_config[idp] = self._parse_idp_config(child) + # Add this variable so we can dynamically show OIDC IdP in Vue template + self.app.config.oidc[idp] = True if len(self.oidc_backends_config) == 0: raise ParseError("No valid provider configuration parsed.") except ImportError: @@ -102,8 +105,14 @@ class AuthnzManager(object): '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 + if config_xml.find('api_url') is not None: + rtv['api_url'] = config_xml.find('api_url').text + if config_xml.find('url') is not None: + rtv['url'] = config_xml.find('url').text + return rtv def _unify_provider_name(self, provider): diff --git a/lib/galaxy/authnz/psa_authnz.py b/lib/galaxy/authnz/psa_authnz.py index c5170a0b61b..106672426e4 100644 --- a/lib/galaxy/authnz/psa_authnz.py +++ b/lib/galaxy/authnz/psa_authnz.py @@ -86,7 +86,7 @@ DISCONNECT_PIPELINE = ( class PSAAuthnz(IdentityProvider): def __init__(self, provider, oidc_config, oidc_backend_config): self.config = {'provider': provider.lower()} - for key, value in oidc_config.iteritems(): + for key, value in oidc_config.items(): self.config[setting_name(key)] = value self.config[setting_name('USER_MODEL')] = 'models.User' @@ -110,6 +110,10 @@ class PSAAuthnz(IdentityProvider): self.config['redirect_uri'] = oidc_backend_config.get('redirect_uri') if oidc_backend_config.get('prompt') is not None: self.config[setting_name('AUTH_EXTRA_ARGUMENTS')]['prompt'] = oidc_backend_config.get('prompt') + if oidc_backend_config.get('api_url') is not None: + self.config[setting_name('API_URL')] = oidc_backend_config.get('api_url') + if oidc_backend_config.get('url') is not None: + self.config[setting_name('URL')] = oidc_backend_config.get('url') def _get_helper(self, name, do_import=False): this_config = self.config.get(setting_name(name), DEFAULTS.get(name, None)) From d4c33f7386146873b111960f9d49a34540f727a3 Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Tue, 12 Mar 2019 20:56:37 +0100 Subject: [PATCH 05/12] social-auth-core should be pinned... can't be optional right now --- lib/galaxy/dependencies/conditional-requirements.txt | 3 --- .../dependencies/pipfiles/default/pinned-requirements.txt | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/galaxy/dependencies/conditional-requirements.txt b/lib/galaxy/dependencies/conditional-requirements.txt index 2f6653357e9..b406a2e03e4 100644 --- a/lib/galaxy/dependencies/conditional-requirements.txt +++ b/lib/galaxy/dependencies/conditional-requirements.txt @@ -24,6 +24,3 @@ pykube==0.15.0 kamaki watchdog - -# OIDC dependencies -social-auth-core[openidconnect]==3.1.0 diff --git a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt index a6792e1c7dd..96c1eae6166 100644 --- a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt @@ -140,6 +140,7 @@ rsa==4.0 s3transfer==0.1.13 simplejson==3.16.0 six==1.11.0 +social-auth-core[openidconnect]==3.1.0 sqlalchemy-migrate==0.12.0 sqlalchemy-utils==0.33.11 sqlalchemy==1.2.18 From 993d899e9c5c4f73ab5fe43e755347af9c6bf5d6 Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Wed, 17 Jul 2019 22:47:40 +0200 Subject: [PATCH 06/12] Add Okta to oidc_backends_config.xml.sample --- .../config/sample/oidc_backends_config.xml.sample | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/galaxy/config/sample/oidc_backends_config.xml.sample b/lib/galaxy/config/sample/oidc_backends_config.xml.sample index 90b157b1632..c4b832348f8 100644 --- a/lib/galaxy/config/sample/oidc_backends_config.xml.sample +++ b/lib/galaxy/config/sample/oidc_backends_config.xml.sample @@ -108,4 +108,14 @@ Please mind `http` and `https`. consent + + ... + ... + http://localhost:8080/authnz/okta/callback + + https://${company}.okta.com/oauth2 + From 341d555ad68ddf55a4b0b894ee3bdc7b16d0f397 Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Wed, 17 Jul 2019 22:53:12 +0200 Subject: [PATCH 07/12] Add documentation on how to get the application set up in Okta. --- .../config/sample/oidc_backends_config.xml.sample | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/config/sample/oidc_backends_config.xml.sample b/lib/galaxy/config/sample/oidc_backends_config.xml.sample index c4b832348f8..18ae8b18170 100644 --- a/lib/galaxy/config/sample/oidc_backends_config.xml.sample +++ b/lib/galaxy/config/sample/oidc_backends_config.xml.sample @@ -115,7 +115,18 @@ Please mind `http` and `https`. - https://${company}.okta.com/oauth2 + ... From dbe1fac5e87a0105ae437e86491e8beeb5eed609 Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Tue, 24 Sep 2019 08:36:46 +0200 Subject: [PATCH 08/12] Update okta backend name --- lib/galaxy/authnz/psa_authnz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/authnz/psa_authnz.py b/lib/galaxy/authnz/psa_authnz.py index 8dc0e04f53d..4502c1447d0 100644 --- a/lib/galaxy/authnz/psa_authnz.py +++ b/lib/galaxy/authnz/psa_authnz.py @@ -21,7 +21,7 @@ BACKENDS = { 'google': 'social_core.backends.google_openidconnect.GoogleOpenIdConnect', 'globus': 'social_core.backends.globus.GlobusOpenIdConnect', 'elixir': 'social_core.backends.elixir.ElixirOpenIdConnect', - 'okta': 'social_core.backends.okta.OktaOpenIdConnect' + 'okta': 'social_core.backends.okta_openidconnect.OktaOpenIdConnect' } BACKENDS_NAME = { From 44ad8910f1b4f3d64daa4ef8b1cc9fc6d49f2254 Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Wed, 18 Mar 2020 23:33:40 +0100 Subject: [PATCH 09/12] Update social-auth-core to version 3.3.0 and allow no secondary auth to be set if the provider isn't google --- lib/galaxy/authnz/psa_authnz.py | 6 ++++-- .../dependencies/pipfiles/default/pinned-requirements.txt | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/authnz/psa_authnz.py b/lib/galaxy/authnz/psa_authnz.py index 0ef26891ff0..b8b3388dfd5 100644 --- a/lib/galaxy/authnz/psa_authnz.py +++ b/lib/galaxy/authnz/psa_authnz.py @@ -116,8 +116,10 @@ class PSAAuthnz(IdentityProvider): # Secondary AuthZ with Google identities is currently supported if provider != "google": - del self.config["SOCIAL_AUTH_SECONDARY_AUTH_PROVIDER"] - del self.config["SOCIAL_AUTH_SECONDARY_AUTH_ENDPOINT"] + if "SOCIAL_AUTH_SECONDARY_AUTH_PROVIDER" in self.config: + del self.config["SOCIAL_AUTH_SECONDARY_AUTH_PROVIDER"] + if "SOCIAL_AUTH_SECONDARY_AUTH_ENDPOINT" in self.config: + del self.config["SOCIAL_AUTH_SECONDARY_AUTH_ENDPOINT"] def _setup_idp(self, oidc_backend_config): self.config[setting_name('AUTH_EXTRA_ARGUMENTS')] = {'access_type': 'offline'} diff --git a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt index 0d47bdffdc2..a2deae34b45 100644 --- a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt @@ -170,7 +170,7 @@ setuptools-scm==3.5.0 shellescape==3.4.1 simplejson==3.17.0 six==1.11.0 -social-auth-core[openidconnect]==3.1.0+gx0 +social-auth-core[openidconnect]==3.3.0 sqlalchemy-migrate==0.13.0 sqlalchemy-utils==0.36.1 sqlalchemy==1.3.13 From 78c56f67a3801159cc08e373feac31cf4a119e44 Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Fri, 27 Mar 2020 20:56:04 +0100 Subject: [PATCH 10/12] Revert config/oidc_backends_config.xml.sample --- config/oidc_backends_config.xml.sample | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 120000 config/oidc_backends_config.xml.sample diff --git a/config/oidc_backends_config.xml.sample b/config/oidc_backends_config.xml.sample deleted file mode 100644 index 0379005f51f..00000000000 --- a/config/oidc_backends_config.xml.sample +++ /dev/null @@ -1 +0,0 @@ -../lib/galaxy/config/sample/oidc_backends_config.xml.sample \ No newline at end of file diff --git a/config/oidc_backends_config.xml.sample b/config/oidc_backends_config.xml.sample new file mode 120000 index 00000000000..0379005f51f --- /dev/null +++ b/config/oidc_backends_config.xml.sample @@ -0,0 +1 @@ +../lib/galaxy/config/sample/oidc_backends_config.xml.sample \ No newline at end of file From 5c79976032dc28c03f43450f7e2e603869386e0d Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Fri, 27 Mar 2020 22:13:53 +0100 Subject: [PATCH 11/12] Prettify login --- .../galaxy/scripts/components/login/Login.vue | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/client/galaxy/scripts/components/login/Login.vue b/client/galaxy/scripts/components/login/Login.vue index 2d4bd92e4ca..3c84fc76853 100644 --- a/client/galaxy/scripts/components/login/Login.vue +++ b/client/galaxy/scripts/components/login/Login.vue @@ -71,12 +71,12 @@ export default { props: { show_welcome_with_login: { type: Boolean, - required: false, + required: false }, welcome_url: { type: String, - required: false, - }, + required: false + } }, data() { const galaxy = getGalaxyInstance(); @@ -98,25 +98,25 @@ export default { session_csrf_token: galaxy.session_csrf_token, enable_oidc: galaxy.config.enable_oidc, oidc_idps: galaxy.config.oidc, - oidc_idps_icons: oidc_idps_icons, + oidc_idps_icons: oidc_idps_icons }; }, computed: { messageShow() { return this.messageText != null; - }, + } }, methods: { - toggleLogin: function () { + toggleLogin: function() { if (this.$root.toggleLogin) { this.$root.toggleLogin(); } }, - submitGalaxyLogin: function (method) { + submitGalaxyLogin: function(method) { const rootUrl = getAppRoot(); axios .post(`${rootUrl}user/login`, this.$data) - .then((response) => { + .then(response => { if (response.data.message && response.data.status) { alert(response.data.message); } @@ -128,43 +128,43 @@ export default { window.location = `${rootUrl}`; } }) - .catch((error) => { + .catch(error => { this.messageVariant = "danger"; const message = error.response.data && error.response.data.err_msg; this.messageText = message || "Login failed for an unknown reason."; }); }, - submitOIDCLogin: function (idp) { + submitOIDCLogin: function(idp) { const rootUrl = getAppRoot(); axios .post(`${rootUrl}authnz/${idp}/login`) - .then((response) => { + .then(response => { if (response.data.redirect_uri) { window.location = response.data.redirect_uri; } // Else do something intelligent or maybe throw an error -- what else does this endpoint possibly return? }) - .catch((error) => { + .catch(error => { this.messageVariant = "danger"; const message = error.response.data && error.response.data.err_msg; this.messageText = message || "Login failed for an unknown reason."; }); }, - reset: function (ev) { + reset: function(ev) { const rootUrl = getAppRoot(); ev.preventDefault(); axios .post(`${rootUrl}user/reset_password`, { email: this.login }) - .then((response) => { + .then(response => { this.messageVariant = "info"; this.messageText = response.data.message; }) - .catch((error) => { + .catch(error => { this.messageVariant = "danger"; const message = error.response.data && error.response.data.err_msg; this.messageText = message || "Password reset failed for an unknown reason."; }); - }, - }, + } + } }; From 2d2d54f315d891d0d3c86d77fc945c7d0a3fd2b2 Mon Sep 17 00:00:00 2001 From: Peter Selten Date: Tue, 21 Apr 2020 22:52:22 +0200 Subject: [PATCH 12/12] Fix styling issues of vue component --- .../galaxy/scripts/components/login/Login.vue | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/client/galaxy/scripts/components/login/Login.vue b/client/galaxy/scripts/components/login/Login.vue index 3c84fc76853..b52e46ca6a3 100644 --- a/client/galaxy/scripts/components/login/Login.vue +++ b/client/galaxy/scripts/components/login/Login.vue @@ -71,12 +71,12 @@ export default { props: { show_welcome_with_login: { type: Boolean, - required: false + required: false, }, welcome_url: { type: String, - required: false - } + required: false, + }, }, data() { const galaxy = getGalaxyInstance(); @@ -84,7 +84,7 @@ export default { const oidc_idps_icons = { google: "https://developers.google.com/identity/images/btn_google_signin_light_normal_web.png", elixir: "https://elixir-europe.org/sites/default/files/images/login-button-orange.png", - okta: "https://www.okta.com/sites/all/themes/Okta/images/blog/Logos/Okta_Logo_BrightBlue_Medium.png" + okta: "https://www.okta.com/sites/all/themes/Okta/images/blog/Logos/Okta_Logo_BrightBlue_Medium.png", }; return { login: null, @@ -98,25 +98,25 @@ export default { session_csrf_token: galaxy.session_csrf_token, enable_oidc: galaxy.config.enable_oidc, oidc_idps: galaxy.config.oidc, - oidc_idps_icons: oidc_idps_icons + oidc_idps_icons: oidc_idps_icons, }; }, computed: { messageShow() { return this.messageText != null; - } + }, }, methods: { - toggleLogin: function() { + toggleLogin: function () { if (this.$root.toggleLogin) { this.$root.toggleLogin(); } }, - submitGalaxyLogin: function(method) { + submitGalaxyLogin: function (method) { const rootUrl = getAppRoot(); axios .post(`${rootUrl}user/login`, this.$data) - .then(response => { + .then((response) => { if (response.data.message && response.data.status) { alert(response.data.message); } @@ -128,43 +128,43 @@ export default { window.location = `${rootUrl}`; } }) - .catch(error => { + .catch((error) => { this.messageVariant = "danger"; const message = error.response.data && error.response.data.err_msg; this.messageText = message || "Login failed for an unknown reason."; }); }, - submitOIDCLogin: function(idp) { + submitOIDCLogin: function (idp) { const rootUrl = getAppRoot(); axios .post(`${rootUrl}authnz/${idp}/login`) - .then(response => { + .then((response) => { if (response.data.redirect_uri) { window.location = response.data.redirect_uri; } // Else do something intelligent or maybe throw an error -- what else does this endpoint possibly return? }) - .catch(error => { + .catch((error) => { this.messageVariant = "danger"; const message = error.response.data && error.response.data.err_msg; this.messageText = message || "Login failed for an unknown reason."; }); }, - reset: function(ev) { + reset: function (ev) { const rootUrl = getAppRoot(); ev.preventDefault(); axios .post(`${rootUrl}user/reset_password`, { email: this.login }) - .then(response => { + .then((response) => { this.messageVariant = "info"; this.messageText = response.data.message; }) - .catch(error => { + .catch((error) => { this.messageVariant = "danger"; const message = error.response.data && error.response.data.err_msg; this.messageText = message || "Password reset failed for an unknown reason."; }); - } - } + }, + }, };