Skip to content

Commit

Permalink
Refactor in jwtVendor 1
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <[email protected]>
  • Loading branch information
RyanL1997 committed Aug 23, 2023
1 parent 8eac5cd commit c1a825b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,22 @@ public String createJwt(
List<String> roles,
List<String> backendRoles
) throws Exception {
long timeMillis = timeProvider.getAsLong();
Instant now = Instant.ofEpochMilli(timeProvider.getAsLong());
final long nowAsMillis = timeProvider.getAsLong();
final Instant nowAsInstant = Instant.ofEpochMilli(timeProvider.getAsLong());

jwtProducer.setSignatureProvider(JwsUtils.getSignatureProvider(signingKey));
JwtClaims jwtClaims = new JwtClaims();
JwtToken jwt = new JwtToken(jwtClaims);

jwtClaims.setIssuer(issuer);

jwtClaims.setIssuedAt(timeMillis);
jwtClaims.setIssuedAt(nowAsMillis);

jwtClaims.setSubject(subject);

jwtClaims.setAudience(audience);

jwtClaims.setNotBefore(timeMillis);
jwtClaims.setNotBefore(nowAsMillis);

expirySeconds = (expirySeconds == null) ? 300 : expirySeconds;
if (expirySeconds <= 0) {
Expand Down

0 comments on commit c1a825b

Please sign in to comment.