Fixed an integer overflow that caused the token to always be refreshed

This commit is contained in:
Lee Newson 2014-05-31 10:09:42 +10:00
parent 4d8c3d7d73
commit b52801de25

View file

@ -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();
}