Created
April 26, 2019 20:19
-
-
Save corneliouzbett/b4995291671daa819b4f0d31c692593b to your computer and use it in GitHub Desktop.
Using Json web token (JWT) to create a token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String generateToken(Map<String, Object> claims) { | |
return Jwts.builder() | |
.setClaims(claims) | |
.setExpiration(generateExpirationDate()) | |
.signWith(SignatureAlgorithm.HS512, secret) | |
.compact(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@