Class JWTUtil
java.lang.Object
de.julianweinelt.datacat.flow.util.JWTUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.auth0.jwt.interfaces.DecodedJWTDecode the given JWT token.getUsername(String token) static JWTUtilinstance()refreshToken(String token) Generate a JWT token for the given username.booleanVerifies if the givenStringis a valid JWT token.booleanverifyRefresh(String token, Consumer<String> errorConsumer) Verifies if the givenStringis a valid JWT token.
-
Constructor Details
-
JWTUtil
public JWTUtil()
-
-
Method Details
-
instance
-
token
Generate a JWT token for the given username. -
refreshToken
-
decode
Decode the given JWT token.- Parameters:
token- the JWT token as aString- Returns:
- the decoded JWT token as a
DecodedJWT, or null if the token is invalid
-
getUsername
-
getScope
-
verify
Verifies if the givenStringis a valid JWT token.- Parameters:
token- the JWT token as aString- Returns:
trueif the token is valid,falseotherwise
-
verifyRefresh
Verifies if the givenStringis a valid JWT token.- Parameters:
token- the JWT token as aString- Returns:
trueif the token is valid,falseotherwise
-