File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/java/org/opensearch/security/authtoken/jwt Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -116,22 +116,22 @@ public String createJwt(
116116 List <String > roles ,
117117 List <String > backendRoles
118118 ) throws Exception {
119- long timeMillis = timeProvider .getAsLong ();
120- Instant now = Instant .ofEpochMilli (timeProvider .getAsLong ());
119+ final long nowAsMillis = timeProvider .getAsLong ();
120+ final Instant nowAsInstant = Instant .ofEpochMilli (timeProvider .getAsLong ());
121121
122122 jwtProducer .setSignatureProvider (JwsUtils .getSignatureProvider (signingKey ));
123123 JwtClaims jwtClaims = new JwtClaims ();
124124 JwtToken jwt = new JwtToken (jwtClaims );
125125
126126 jwtClaims .setIssuer (issuer );
127127
128- jwtClaims .setIssuedAt (timeMillis );
128+ jwtClaims .setIssuedAt (nowAsMillis );
129129
130130 jwtClaims .setSubject (subject );
131131
132132 jwtClaims .setAudience (audience );
133133
134- jwtClaims .setNotBefore (timeMillis );
134+ jwtClaims .setNotBefore (nowAsMillis );
135135
136136 expirySeconds = (expirySeconds == null ) ? 300 : expirySeconds ;
137137 if (expirySeconds <= 0 ) {
You can’t perform that action at this time.
0 commit comments