auth_saml: handle underscores in idp slug (#52981)
This commit is contained in:
parent
b429cfd794
commit
e7803635b9
|
@ -40,7 +40,7 @@ class SAMLAuthenticator(BaseAuthenticator):
|
|||
yield (idp.get('SLUG') or str(idx), idp)
|
||||
|
||||
def autorun(self, request, block_id):
|
||||
auth_id, instance_slug = block_id.split('_')
|
||||
auth_id, instance_slug = block_id.split('_', 1)
|
||||
assert auth_id == self.id
|
||||
|
||||
for slug, instance in self.instances(request):
|
||||
|
|
|
@ -249,6 +249,10 @@ def test_login_autorun(db, app, settings):
|
|||
response = app.get('/login/', status=302)
|
||||
assert '/accounts/saml/login/?entityID=' in response['Location']
|
||||
|
||||
settings.MELLON_IDENTITY_PROVIDERS[0]['SLUG'] = 'slug_with_underscore'
|
||||
response = app.get('/login/', status=302)
|
||||
assert '/accounts/saml/login/?entityID=' in response['Location']
|
||||
|
||||
|
||||
def test_save_account_on_delete_user(db):
|
||||
user = User.objects.create()
|
||||
|
|
Loading…
Reference in New Issue