Skip to content

Commit 1cfbe26

Browse files
downgrade java-jwt dependency to 3.10.2 (#902)
Keeping java-jwt dependency version at 3.10.2 to solve #900
1 parent b0738bb commit 1cfbe26

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ dependencies {
6666
compile group: 'com.cronutils', name: 'cron-utils', version: '9.2.0'
6767
compile group: 'io.micrometer', name: 'micrometer-core', version: '1.10.2'
6868
compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
69-
compile group: 'com.auth0', name: 'java-jwt', version:'4.4.0'
69+
compile group: 'com.auth0', name: 'java-jwt', version:'3.10.2'
7070
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.21.9'
7171
compile group: 'com.google.api.grpc', name: 'proto-google-common-protos', version: '2.10.0'
7272
compile group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.21.9'

src/main/java/com/uber/cadence/serviceclient/auth/AdminJwtAuthorizationProvider.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.nio.charset.StandardCharsets;
2424
import java.security.interfaces.RSAPrivateKey;
2525
import java.security.interfaces.RSAPublicKey;
26+
import java.sql.Date;
2627
import java.time.Instant;
2728

2829
public class AdminJwtAuthorizationProvider implements IAuthorizationProvider {
@@ -42,8 +43,8 @@ public byte[] getAuthToken() {
4243
int JWT_TTL_SECONDS = 60 * 10;
4344
jwtBuilder.withClaim("admin", true);
4445
jwtBuilder.withClaim("ttl", JWT_TTL_SECONDS);
45-
jwtBuilder.withIssuedAt(now);
46-
jwtBuilder.withExpiresAt(now.plusSeconds(JWT_TTL_SECONDS));
46+
jwtBuilder.withIssuedAt(Date.from(now));
47+
jwtBuilder.withExpiresAt(Date.from(now.plusSeconds(JWT_TTL_SECONDS)));
4748
return jwtBuilder
4849
.sign(Algorithm.RSA256(this.rsaPublicKey, this.rsaPrivateKey))
4950
.getBytes(StandardCharsets.UTF_8);

0 commit comments

Comments
 (0)