Merge pull request #443 from lnewson/master

Fixed an integer overflow that caused the token to be refreshed too often
This commit is contained in:
Stian Thorgersen 2014-06-02 09:35:11 +01:00
commit 4662781213

View file

@ -173,7 +173,7 @@ public class KeycloakInstalled {
} }
public String getTokenString(long minValidity, TimeUnit unit) throws VerificationException, IOException, ServerRequest.HttpFailure { 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()) { if (expires < System.currentTimeMillis()) {
refreshToken(); refreshToken();
} }