diff --git a/pom.xml b/pom.xml index 7a8b952a87..b7b412e40e 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ 0.50 false - 0.11.5 + 0.12.3 diff --git a/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java b/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java index 85ed1f69ed..71c05eb789 100644 --- a/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java +++ b/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java @@ -2,7 +2,6 @@ import io.jsonwebtoken.JwtBuilder; import io.jsonwebtoken.Jwts; -import io.jsonwebtoken.SignatureAlgorithm; import io.jsonwebtoken.jackson.io.JacksonSerializer; import org.kohsuke.github.authorization.AuthorizationProvider; @@ -173,16 +172,16 @@ private String refreshJWT() { // Let's set the JWT Claims JwtBuilder builder = Jwts.builder() - .setIssuedAt(Date.from(issuedAt)) - .setExpiration(Date.from(expiration)) - .setIssuer(this.applicationId) - .signWith(privateKey, SignatureAlgorithm.RS256); + .issuedAt(Date.from(issuedAt)) + .expiration(Date.from(expiration)) + .issuer(this.applicationId) + .signWith(privateKey, Jwts.SIG.RS256); // Token will refresh 2 minutes before it expires validUntil = expiration.minus(Duration.ofMinutes(2)); // Builds the JWT and serializes it to a compact, URL-safe string - return builder.serializeToJsonWith(new JacksonSerializer<>()).compact(); + return builder.json(new JacksonSerializer<>()).compact(); } Instant getIssuedAt(Instant now) {