mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
* add error log on SSO check failure
* sso_check_provider: fix by comparing against id
the name is the pretty printed version which not necessarily is the same
as the provider id it is compared against. This fails e.g. for the
microsoft allauth extension where the id is microsoft, but the name is
"Microsoft Graph".
Closes: #5330
(cherry picked from commit ee5416719f
)
Co-authored-by: Hendrik v. Raven <hendrik@consetetur.de>
This commit is contained in:
parent
dd6e225cda
commit
699fb83dd4
@ -38,9 +38,13 @@ def sso_check_provider(provider):
|
||||
from allauth.socialaccount.models import SocialApp
|
||||
|
||||
# First, check that the provider is enabled
|
||||
apps = SocialApp.objects.filter(provider__iexact=provider.name)
|
||||
apps = SocialApp.objects.filter(provider__iexact=provider.id)
|
||||
|
||||
if not apps.exists():
|
||||
logging.error(
|
||||
"SSO SocialApp %s does not exist (known providers: %s)",
|
||||
provider.id, [obj.provider for obj in SocialApp.objects.all()]
|
||||
)
|
||||
return False
|
||||
|
||||
# Next, check that the provider is correctly configured
|
||||
|
Loading…
Reference in New Issue
Block a user