From 5a1aab3a49b3718e15b5099adfa9e41aeecb0bb9 Mon Sep 17 00:00:00 2001 From: Gabriel Sroka Date: Tue, 28 Jan 2025 08:06:16 -0800 Subject: [PATCH] Update jwt.py 60 minutes is too long and causes error #382 --- okta/jwt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/okta/jwt.py b/okta/jwt.py index 8dd87197..d22980a6 100644 --- a/okta/jwt.py +++ b/okta/jwt.py @@ -17,7 +17,7 @@ class JWT(): OAUTH_ENDPOINT = "/oauth2/v1/token" HASH_ALGORITHM = "RS256" PEM_FORMAT = "PKCS1" - ONE_HOUR = 1 * 60 * 60 + EXPIRATION = 1 * 60 * 59 JWT_OPTIONS = { 'verify_signature': True, 'verify_aud': True, @@ -116,7 +116,7 @@ def create_token(org_url, client_id, private_key, kid=None): my_pem, _ = JWT.get_PEM_JWK(private_key) # Get current time and expiry time for token issued_time = int(time.time()) - expiry_time = issued_time + JWT.ONE_HOUR + expiry_time = issued_time + JWT.EXPIRATION # generate unique JWT ID generated_JWT_ID = str(uuid.uuid4())