Skip to content

Commit

Permalink
Skip 'at_hash' claim validation when missing
Browse files Browse the repository at this point in the history
  • Loading branch information
browniebroke committed Nov 7, 2023
1 parent 6c69c60 commit f7ed3a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion social_core/backends/open_id_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ def validate_and_return_id_token(self, id_token, access_token):

# pyjwt does not validate OIDC claims
# see https://github.com/jpadilla/pyjwt/pull/296
if claims.get("at_hash") != self.calc_at_hash(access_token, key["alg"]):
if "at_hash" in claims and claims["at_hash"] != self.calc_at_hash(
access_token, key["alg"]
):
raise AuthTokenError(self, "Invalid access token")

self.validate_claims(claims)
Expand Down

0 comments on commit f7ed3a3

Please sign in to comment.