Skip to content

Commit

Permalink
Issue 67: Update for keycloak 19 (#68)
Browse files Browse the repository at this point in the history
* updated keycloak version
Signed-off-by: Apoorva Shivpuriya <[email protected]>
  • Loading branch information
apoorva918 authored Dec 21, 2022
1 parent 195089d commit c808f3e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void update(AuthorizationResponse response) {
}

boolean isTokenTimeToLiveSufficient() {
return token.getExpiration() - tokenMinimumTimeToLiveSecs > Time.currentTime();
return token.getExp() - tokenMinimumTimeToLiveSecs > Time.currentTime();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.keycloak.common.util.KeyUtils;
import org.keycloak.jose.jws.JWSBuilder;
import org.keycloak.representations.AccessToken;
import org.keycloak.common.crypto.CryptoIntegration;

import java.security.KeyPair;
import java.security.PublicKey;
Expand All @@ -32,6 +33,7 @@ public class AccessTokenIssuer implements PublicKeyLocator {
private final KeyPair issuerKeyPair;

public AccessTokenIssuer() {
CryptoIntegration.init(null);
issuerKeyPair = KeyUtils.generateRsaKeyPair(2048);
}

Expand Down Expand Up @@ -71,7 +73,7 @@ public String issue(AccessToken accessToken) {
* @return
*/
private static int computeExpiration(AccessToken token, Duration expiration) {
int issuedAt = token.getIssuedAt();
int issuedAt = token.getIat().intValue();
int expirationInSeconds = (int) expiration.toMillis() / 1000;
return issuedAt + expirationInSeconds;
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

guavaVersion=28.2-jre
junitVersion=4.13.2
keycloakVersion=15.1.1
keycloakVersion=19.0.3
mockitoVersion=3.3.3
pravegaVersion=0.12.0
slf4jVersion=1.7.30
Expand Down

0 comments on commit c808f3e

Please sign in to comment.