Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support java.time Instant and java.time Clock #286

Closed
Marthym opened this issue Nov 30, 2017 · 2 comments
Closed

Support java.time Instant and java.time Clock #286

Marthym opened this issue Nov 30, 2017 · 2 comments

Comments

@Marthym
Copy link

Marthym commented Nov 30, 2017

It should be a great thing to be able to support java.time.Instant and java.time.Clock instant of Date and io.jsonwebtoken.Clock.

Jwts.builder()
       .setSubject(user.username())
       .setId(tokenId.toString())
       .setExpiration(Instant.now().plus(expiration))
       .setIssuedAt(Date.from(now))
       .addClaims(claimsBldr.build())
       .signWith(SignatureAlgorithm.HS512, signingKey)
       .compact();
Jwts.parser()
       .setSigningKey(signingKey)
       .setClock(Clock.systemUTC())
       .parseClaimsJws(token.replace(PREFIX, ""))
       .getBody();
@lhazlewood
Copy link
Contributor

This depends on #308

@lhazlewood
Copy link
Contributor

Closing as duplicate of #235. Please #235 for work/discussion.

@lhazlewood lhazlewood removed this from the 1.0 milestone Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants