public class JWTAuth extends Object
| Constructor and Description |
|---|
JWTAuth() |
| Modifier and Type | Method and Description |
|---|---|
AuthenticatedUser |
getCurrentUser()
Get the currently logged in user
|
String |
signToken(AuthenticatedUser user)
Sign the given claims
|
com.nimbusds.jwt.SignedJWT |
signToken(com.nimbusds.jwt.JWTClaimsSet claims)
Sign the given claims
|
AuthenticatedUser |
validateToken(String jwtString)
Check the given JWT and parse it into a user object
|
com.nimbusds.jwt.SignedJWT |
verifyToken(String jwtString)
Check the given JWT
|
public com.nimbusds.jwt.SignedJWT signToken(com.nimbusds.jwt.JWTClaimsSet claims)
claims - the claims to signpublic String signToken(AuthenticatedUser user)
user - the user to create the claims frompublic com.nimbusds.jwt.SignedJWT verifyToken(String jwtString) throws ParseException
jwtString - the JSON Web TokenParseException - if the token cannot be parsedpublic AuthenticatedUser validateToken(String jwtString) throws ParseException
jwtString - the JSON Web TokenParseException - if the token cannot be parsedpublic AuthenticatedUser getCurrentUser()
Copyright © 2016 Taimos GmbH. All rights reserved.