diff --git a/src/factiva/analytics/auth/oauthuser.py b/src/factiva/analytics/auth/oauthuser.py index 60fd57b..8725404 100755 --- a/src/factiva/analytics/auth/oauthuser.py +++ b/src/factiva/analytics/auth/oauthuser.py @@ -187,7 +187,8 @@ def get_id_token(self) -> bool: self._id_token = response_body['id_token'] self._access_token = response_body['access_token'] bearer_payload = eval(base64.b64decode(self._access_token.split('.')[1] + '==').decode('utf-8')) - self._id_expiration = datetime.datetime.utcfromtimestamp(int(bearer_payload['exp'])).replace(tzinfo=datetime.timezone.utc) + # self._id_expiration = datetime.datetime.utcfromtimestamp(int(bearer_payload['exp'])).replace(tzinfo=datetime.timezone.utc) + self._id_expiration = datetime.datetime.fromtimestamp(int(bearer_payload['exp']), datetime.UTC) return True elif authn_response.status_code == 403: raise PermissionError('Invalid user credentials') @@ -232,7 +233,8 @@ def get_jwt_token(self) -> bool: response_body = authz_response.json() self._jwt_token = response_body["access_token"] bearer_payload = eval(base64.b64decode(self._jwt_token.split('.')[1] + '==').decode('utf-8')) - self._jwt_expiration = datetime.datetime.utcfromtimestamp(int(bearer_payload['exp'])).replace(tzinfo=datetime.timezone.utc) + # self._jwt_expiration = datetime.datetime.utcfromtimestamp(int(bearer_payload['exp'])).replace(tzinfo=datetime.timezone.utc) + self._jwt_expiration = datetime.datetime.fromtimestamp(int(bearer_payload['exp']), datetime.UTC) return True