Skip to content

Commit

Permalink
Handle encrypted assertions
Browse files Browse the repository at this point in the history
(Partly) resolves SUNET#9
  • Loading branch information
jkakavas committed May 27, 2017
1 parent fee8a96 commit 621cd81
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/svs/inacademia_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ def _get_user_id(self, auth_response):
return None

def _translate_response(self, auth_response, state):
# translate() will handle potentially encrypted SAML Assertions
# auth_response object will also be modified
internal_resp = super()._translate_response(auth_response, state)

if 'eduPersonAffiliation' not in auth_response.ava:
raise SATOSAAuthenticationError(state, 'Missing eduPersonAffiliation in response from IdP.')

internal_resp = super()._translate_response(auth_response, state)

internal_resp.user_id = self._get_user_id(auth_response)
if not internal_resp.user_id:
raise SATOSAAuthenticationError(state, 'Failed to construct persistent user id from IdP response.')
Expand Down

0 comments on commit 621cd81

Please sign in to comment.