Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Version 0.6
- Remove upper version pins of dependencies
- Support friendly names for SAML assertions (set `'saml_friendly_names': True`
in the auth provider settings)
- Include more verbose authentication data in ``IdentityRetrievalFailed`` exception details

Version 0.5.6
-------------
Expand Down
2 changes: 1 addition & 1 deletion flask_multipass/providers/authlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,5 @@ def get_identity_from_auth(self, auth_info):
identifier = auth_info.data.get(self.id_field)
if not identifier:
raise IdentityRetrievalFailed(f'Identifier ({self.id_field}) missing in authlib response',
provider=self)
details=auth_info.data, provider=self)
return IdentityInfo(self, identifier=identifier, **auth_info.data)
6 changes: 4 additions & 2 deletions flask_multipass/providers/saml.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@ def get_identity_from_auth(self, auth_info):
identifier = auth_info.data.get(self.id_field)
if isinstance(identifier, list):
if len(identifier) != 1:
raise IdentityRetrievalFailed('Identifier has multiple elements', provider=self)
raise IdentityRetrievalFailed('Identifier has multiple elements',
details=identifier, provider=self)
identifier = identifier[0]
if not identifier:
raise IdentityRetrievalFailed('Identifier missing in saml response', provider=self)
raise IdentityRetrievalFailed('Identifier missing in saml response',
details=auth_info.data, provider=self)
return IdentityInfo(self, identifier=identifier, **auth_info.data)
3 changes: 2 additions & 1 deletion flask_multipass/providers/shibboleth.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@ def __init__(self, *args, **kwargs):
def get_identity_from_auth(self, auth_info):
identifier = auth_info.data.get(self.id_field)
if not identifier:
raise IdentityRetrievalFailed('Identifier missing in shibboleth response', provider=self)
raise IdentityRetrievalFailed('Identifier missing in shibboleth response',
details=auth_info.data, provider=self)
return IdentityInfo(self, identifier=identifier, **auth_info.data)