Class JWTCredentials
java.lang.Object
dev.getelements.elements.security.JWTCredentials
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts thisJWTCredentials
toCustomJWTCredentials
, throwing the appropriate exceptions if the conversion is not appropriate for this instance.Finds the audience of the token.Finds the expiration date of the token.Finds the issuer of the token.com.auth0.jwt.interfaces.DecodedJWT
Gets theDecodedJWT
backing this object.static boolean
Checks if a set of credentials is a valid JWT.boolean
verify
(com.auth0.jwt.algorithms.Algorithm algorithm) Verifies the JWT has the required data, and that the signature matches
-
Constructor Details
-
JWTCredentials
Generic JWT Credentials.- Parameters:
token
- the token to parse.
-
-
Method Details
-
isJwt
Checks if a set of credentials is a valid JWT.- Parameters:
credentials
- the credentials- Returns:
- true if JWT, or false otherwise.
-
getDecoded
public com.auth0.jwt.interfaces.DecodedJWT getDecoded()Gets theDecodedJWT
backing this object.- Returns:
- the decoded JWT
-
findIssuer
Finds the issuer of the token. -
findAudience
Finds the audience of the token. -
findExpirationDate
Finds the expiration date of the token. -
verify
public boolean verify(com.auth0.jwt.algorithms.Algorithm algorithm) Verifies the JWT has the required data, and that the signature matches- Returns:
- if the JWT token is valid
-
asCustomCredentials
Converts thisJWTCredentials
toCustomJWTCredentials
, throwing the appropriate exceptions if the conversion is not appropriate for this instance.- Returns:
CustomJWTCredentials
, if the supplied credentials are valid
-