Skip to content

Commit

Permalink
Disable at_hash verification (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
sindrig authored Jan 6, 2022
1 parent eb09623 commit c390134
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fastapi_cloudauth/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ def _verify_claims(self, http_auth: HTTPAuthorizationCredentials) -> bool:
"",
audience=self._aud,
issuer=self._iss,
options={"verify_signature": False, "verify_sub": False}, # done
options={
"verify_signature": False,
"verify_sub": False,
"verify_at_hash": False,
}, # done
)
except jwt.ExpiredSignatureError as e:
if self.auto_error:
Expand Down
1 change: 1 addition & 0 deletions tests/test_cognito.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def test_extra_verify_id_token():
# correct
token = jwt.encode(
{
"at_hash": "some-hash-that-isnt-checked",
"sub": "dummy-ID",
"exp": datetime.utcnow() + timedelta(hours=10),
"iat": datetime.utcnow() - timedelta(hours=10),
Expand Down

0 comments on commit c390134

Please sign in to comment.