File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
src/main/java/com/uber/cadence/serviceclient/auth Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ dependencies {
66
66
compile group : ' com.cronutils' , name : ' cron-utils' , version : ' 9.2.0'
67
67
compile group : ' io.micrometer' , name : ' micrometer-core' , version : ' 1.10.2'
68
68
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 '
70
70
compile group : ' com.google.protobuf' , name : ' protobuf-java' , version : ' 3.21.9'
71
71
compile group : ' com.google.api.grpc' , name : ' proto-google-common-protos' , version : ' 2.10.0'
72
72
compile group : ' com.google.protobuf' , name : ' protobuf-java-util' , version : ' 3.21.9'
Original file line number Diff line number Diff line change 23
23
import java .nio .charset .StandardCharsets ;
24
24
import java .security .interfaces .RSAPrivateKey ;
25
25
import java .security .interfaces .RSAPublicKey ;
26
+ import java .sql .Date ;
26
27
import java .time .Instant ;
27
28
28
29
public class AdminJwtAuthorizationProvider implements IAuthorizationProvider {
@@ -42,8 +43,8 @@ public byte[] getAuthToken() {
42
43
int JWT_TTL_SECONDS = 60 * 10 ;
43
44
jwtBuilder .withClaim ("admin" , true );
44
45
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 ) ));
47
48
return jwtBuilder
48
49
.sign (Algorithm .RSA256 (this .rsaPublicKey , this .rsaPrivateKey ))
49
50
.getBytes (StandardCharsets .UTF_8 );
You can’t perform that action at this time.
0 commit comments