Skip to content

Commit

Permalink
[Fixes GeoNode#12167] providing multiple openid_connect django.allaut…
Browse files Browse the repository at this point in the history
…h socialproviders fails when loading login page
  • Loading branch information
mwallschlaeger committed Apr 18, 2024
1 parent 2ff52e6 commit f424449
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion geonode/people/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ 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:
app = self.get_app(request, provider=provider)
# 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)
if not provider_class:
# In this case, the `provider` argument passed was a
# `provider_id`.
Expand Down

0 comments on commit f424449

Please sign in to comment.