From b52801de25a3cbf1fdfa94be6ac21491d61c70d7 Mon Sep 17 00:00:00 2001 From: Lee Newson Date: Sat, 31 May 2014 10:09:42 +1000 Subject: [PATCH] Fixed an integer overflow that caused the token to always be refreshed --- .../java/org/keycloak/adapters/installed/KeycloakInstalled.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/installed/src/main/java/org/keycloak/adapters/installed/KeycloakInstalled.java b/integration/installed/src/main/java/org/keycloak/adapters/installed/KeycloakInstalled.java index 02304c056c..32ebfdbf6d 100644 --- a/integration/installed/src/main/java/org/keycloak/adapters/installed/KeycloakInstalled.java +++ b/integration/installed/src/main/java/org/keycloak/adapters/installed/KeycloakInstalled.java @@ -173,7 +173,7 @@ public class KeycloakInstalled { } public String getTokenString(long minValidity, TimeUnit unit) throws VerificationException, IOException, ServerRequest.HttpFailure { - long expires = token.getExpiration() * 1000 - unit.toMillis(minValidity); + long expires = ((long) token.getExpiration()) * 1000 - unit.toMillis(minValidity); if (expires < System.currentTimeMillis()) { refreshToken(); }