From b41303542f1857ef2ec1bf5adfc5e1cb9c1fbb55 Mon Sep 17 00:00:00 2001 From: mwallschlaeger Date: Tue, 23 Apr 2024 14:18:41 +0200 Subject: [PATCH] [Fixes #12167] providing multiple openid_connect django.allauth socialproviders fails when loading login page --- geonode/people/adapters.py | 7 +------ .../templates/socialaccount/snippets/provider_list.html | 4 ++-- .../socialaccount/snippets/remaining_providers_list.html | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/geonode/people/adapters.py b/geonode/people/adapters.py index 1f6199f60c5..7d0ef8dacb2 100644 --- a/geonode/people/adapters.py +++ b/geonode/people/adapters.py @@ -267,12 +267,7 @@ def get_provider(self, request=None, provider=None): provider = provider or self.provider_id provider_class = registry.get_class(provider) if provider_class is None or provider_class.uses_apps: - # check if first app provider contains client_id, mutiple apps in a single provider - # get seperated into multiple providers, an this function gets called multiple times - # https://github.com/pennersr/django-allauth/blob/main/docs/socialaccount/providers/openid_connect.rst - if not self.list_apps(request)[0].client_id: - raise (ImproperlyConfigured(f"Missing client_id parameter in provider: {provider} configuration")) - app = self.get_app(request, provider=provider, client_id=self.list_apps(request)[0].client_id) + app = self.get_app(request, provider=provider) if not provider_class: # In this case, the `provider` argument passed was a # `provider_id`. diff --git a/geonode/templates/socialaccount/snippets/provider_list.html b/geonode/templates/socialaccount/snippets/provider_list.html index 89df15609fc..a540e77b4c8 100644 --- a/geonode/templates/socialaccount/snippets/provider_list.html +++ b/geonode/templates/socialaccount/snippets/provider_list.html @@ -7,13 +7,13 @@ {% for provider in socialaccount_providers %} {% if provider.id == "openid" %} {% for brand in provider.get_brands %} - + {{brand.name}} {% endfor %} {% endif %}
- + {% if process == "login" %} {% trans "Sign in with" %} diff --git a/geonode/templates/socialaccount/snippets/remaining_providers_list.html b/geonode/templates/socialaccount/snippets/remaining_providers_list.html index c6e355ba139..5b35ca373be 100644 --- a/geonode/templates/socialaccount/snippets/remaining_providers_list.html +++ b/geonode/templates/socialaccount/snippets/remaining_providers_list.html @@ -7,13 +7,13 @@ {% for provider in other_providers %} {% if provider.id == "openid" %} {% for brand in provider.get_brands %} - + {{brand.name}} {% endfor %} {% endif %}