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:
commit
4662781213
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue