From 436e3f95f7260d610dedf84b7ec08560d8ba555d Mon Sep 17 00:00:00 2001 From: Hsiaoming Yang Date: Wed, 6 Apr 2022 17:37:48 +0900 Subject: [PATCH] Fix validate jwt essential logic ref: https://github.com/lepture/authlib/issues/445 --- authlib/jose/rfc7519/claims.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authlib/jose/rfc7519/claims.py b/authlib/jose/rfc7519/claims.py index 0a5b7ec7..e0730960 100644 --- a/authlib/jose/rfc7519/claims.py +++ b/authlib/jose/rfc7519/claims.py @@ -53,7 +53,7 @@ def __getattr__(self, key): def _validate_essential_claims(self): for k in self.options: - if self.options[k].get('essential') and k not in self: + if self.options[k].get('essential') and not self.get(k): raise MissingClaimError(k) def _validate_claim_value(self, claim_name):