Skip to content

Commit

Permalink
Merge pull request #454 from jkakavas/fix_authn
Browse files Browse the repository at this point in the history
Quick fix for the authentication bypass due to optimizations #451
  • Loading branch information
rohe authored Oct 11, 2017
2 parents 46d24f6 + 6312a41 commit efe27e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/saml2/authn.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ def __call__(self, cookie=None, policy_url=None, logo_url=None,
return resp

def _verify(self, pwd, user):
assert is_equal(pwd, self.passwd[user])
if not is_equal(pwd, self.passwd[user]):
raise ValueError("Wrong password")

def verify(self, request, **kwargs):
"""
Expand Down Expand Up @@ -176,7 +177,7 @@ def verify(self, request, **kwargs):
return_to = create_return_url(self.return_to, _dict["query"][0],
**{self.query_param: "true"})
resp = Redirect(return_to, headers=[cookie])
except (AssertionError, KeyError):
except (ValueError, KeyError):
resp = Unauthorized("Unknown user or wrong password")

return resp
Expand Down

0 comments on commit efe27e2

Please sign in to comment.