anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: gluufederation/oxauth
Issue: passport_social and passport_saml authentication script not determining JWT token expiry correctly

#  Describe the issue
The jwt expiration checks failed to validate the JWT expiration time in some timezone for example: `Central European Summer Time(CEST)`. 
Support issue: https://support.gluu.org/8935/

## Steps To Reproduce
Steps to reproduce the behavior:
1. Install Gluu CE with Passport
2. Update your timezone with `Europe/Rome` i.e. `CEST`
3. Try any passport flow

## Expected behavior
JWT token should be valid in any timezone

## Actual behavior
JWT token expiration check is failing in `CEST` timezone

## Additional context
Currently, we are converting and fetching JWT `exp` time from oxAuth JWT module but somehow later on it is failing to check with python DateTime.


Changed files:
Server/integrations/saml-passport/SamlPassportAuthenticator.py, Server/integrations/passport/PassportExternalAuthenticator.py

diff --git a/Server/integrations/passport/PassportExternalAuthenticator.py b/Server/integrations/passport/PassportExternalAuthenticator.py
index 1dd1b19c7..31b16e3bc 100644
--- a/Server/integrations/passport/PassportExternalAuthenticator.py
+++ b/Server/integrations/passport/PassportExternalAuthenticator.py
@@ -461,7 +461,8 @@ class PersonAuthentication(PersonAuthenticationType):
         # Check if jwt has expired
         jwt_claims = jwt.getClaims()
         try:
-            exp_date = jwt_claims.getClaimAsDate(JwtClaimName.EXPIRATION_TIME)
+            exp_date_timestamp = float(jwt_claims.getClaimAsString(JwtClaimName.EXPIRATION_TIME))
+            exp_date = datetime.datetime.fromtimestamp(exp_date_timestamp)
             hasExpired = exp_date < datetime.datetime.now()
         except:
             print "Exception: The JWT does not have '%s' attribute" % JwtClaimName.EXPIRATION_TIME
diff --git a/Server/integrations/saml-passport/SamlPassportAuthenticator.py b/Server/integrations/saml-passport/SamlPassportAuthenticator.py
index 32bab2df2..63eb749b4 100644
--- a/Server/integrations/saml-passport/SamlPassportAuthenticator.py
+++ b/Server/integrations/saml-passport/SamlPassportAuthenticator.py
@@ -562,7 +562,8 @@ class PersonAuthentication(PersonAuthenticationType):
         # Check if jwt has expired
         jwt_claims = jwt.getClaims()
         try:
-            exp_date = jwt_claims.getClaimAsDate(JwtClaimName.EXPIRATION_TIME)
+            exp_date_timestamp = float(jwt_claims.getClaimAsString(JwtClaimName.EXPIRATION_TIME))
+            exp_date = datetime.datetime.fromtimestamp(exp_date_timestamp)
             hasExpired = exp_date < datetime.datetime.now()
         except:
             print "Exception: The JWT does not have '%s' attribute" % JwtClaimName.EXPIRATION_TIME