fix(oauth): add exp to idToken (#20694)
This commit is contained in:
parent
f5ba787f4b
commit
e0ed7d3b97
2 changed files with 4 additions and 0 deletions
|
|
@ -331,6 +331,8 @@ class OAuthWebRequestValidator(RequestValidator):
|
|||
|
||||
userinfo = get_userinfo(user)
|
||||
|
||||
id_token["exp"] = id_token.get("iat") + token.get("expires_in")
|
||||
|
||||
if userinfo.get("iss"):
|
||||
id_token["iss"] = userinfo.get("iss")
|
||||
|
||||
|
|
@ -363,6 +365,7 @@ class OAuthWebRequestValidator(RequestValidator):
|
|||
|
||||
def get_jwt_bearer_token(self, token, token_handler, request):
|
||||
now = datetime.datetime.now()
|
||||
|
||||
id_token = dict(
|
||||
aud=token.client_id,
|
||||
iat=round(now.timestamp()),
|
||||
|
|
|
|||
|
|
@ -367,6 +367,7 @@ class TestOAuth20(FrappeRequestTestCase):
|
|||
audience=self.client_id,
|
||||
key=self.client_secret,
|
||||
algorithms=["HS256"],
|
||||
options={"verify_signature": True, "require": ["exp", "iat", "aud"]},
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue