Package io.smallrye.jwt.auth.principal
Interface JWTParser
-
- All Known Implementing Classes:
DefaultJWTParser
public interface JWTParserA parser to parse a JWT token and convert it to aJsonWebToken.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.eclipse.microprofile.jwt.JsonWebTokendecrypt(String token, String secret)Parse JWT token.org.eclipse.microprofile.jwt.JsonWebTokendecrypt(String token, PrivateKey key)Parse JWT token.org.eclipse.microprofile.jwt.JsonWebTokendecrypt(String token, SecretKey key)Parse JWT token.org.eclipse.microprofile.jwt.JsonWebTokenparse(String token)Parse JWT token.org.eclipse.microprofile.jwt.JsonWebTokenparse(String token, JWTAuthContextInfo context)Parse JWT token.org.eclipse.microprofile.jwt.JsonWebTokenparseOnly(String token)Parse an already verified signed JWT token.org.eclipse.microprofile.jwt.JsonWebTokenverify(String token, String secret)Parse JWT token.org.eclipse.microprofile.jwt.JsonWebTokenverify(String token, PublicKey key)Parse JWT token.org.eclipse.microprofile.jwt.JsonWebTokenverify(String token, SecretKey key)Parse JWT token.
-
-
-
Method Detail
-
parse
org.eclipse.microprofile.jwt.JsonWebToken parse(String token) throws ParseException
Parse JWT token. The token will be verified or decrypted or decrypted and then verified and converted toJsonWebToken. This method depends on the injectedJWTAuthContextInfoconfiguration context.- Parameters:
token- the JWT token- Returns:
- JsonWebToken
- Throws:
ParseException- parse exception
-
parse
org.eclipse.microprofile.jwt.JsonWebToken parse(String token, JWTAuthContextInfo context) throws ParseException
Parse JWT token. The token will be verified or decrypted or decrypted and then verified and converted toJsonWebToken.- Parameters:
token- the JWT tokencontext- the configuration context which will override the injectedJWTAuthContextInfoconfiguration context.- Returns:
- JsonWebToken
- Throws:
ParseException- parse exception
-
verify
org.eclipse.microprofile.jwt.JsonWebToken verify(String token, PublicKey key) throws ParseException
Parse JWT token. The token will be verified and converted toJsonWebToken.- Parameters:
token- the JWT tokenkey- the public verification key. The injectedJWTAuthContextInfoconfiguration context will be reused, only its publicVerificationKey property will be replaced by this parameter.- Returns:
- JsonWebToken
- Throws:
ParseException- parse exception
-
verify
org.eclipse.microprofile.jwt.JsonWebToken verify(String token, SecretKey key) throws ParseException
Parse JWT token. The token will be verified and converted toJsonWebToken.- Parameters:
token- the JWT tokenkey- the secret verification key. The injectedJWTAuthContextInfoconfiguration context will be reused, only its secretVerificationKey property will be replaced by this parameter.- Returns:
- JsonWebToken
- Throws:
ParseException- parse exception
-
verify
org.eclipse.microprofile.jwt.JsonWebToken verify(String token, String secret) throws ParseException
Parse JWT token. The token will be verified and converted toJsonWebToken.- Parameters:
token- the JWT tokensecret- the secret. The injectedJWTAuthContextInfoconfiguration context will be reused, only its secretVerificationKey property will be replaced after converting this parameter toSecretKey.- Returns:
- JsonWebToken
- Throws:
ParseException- parse exception
-
decrypt
org.eclipse.microprofile.jwt.JsonWebToken decrypt(String token, PrivateKey key) throws ParseException
Parse JWT token. The token will be decrypted and converted toJsonWebToken.- Parameters:
token- the JWT tokenkey- the private decryption key. The injectedJWTAuthContextInfoconfiguration context will be reused, only its privateDecryptionkey property will be replaced by this parameter.- Returns:
- JsonWebToken
- Throws:
ParseException- parse exception
-
decrypt
org.eclipse.microprofile.jwt.JsonWebToken decrypt(String token, SecretKey key) throws ParseException
Parse JWT token. The token will be decrypted and converted toJsonWebToken.- Parameters:
token- the JWT tokenkey- the secret decryption key. The injectedJWTAuthContextInfoconfiguration context will be reused, only its secretDecryptionkey property will be replaced by this parameter.- Returns:
- JsonWebToken
- Throws:
ParseException- parse exception
-
decrypt
org.eclipse.microprofile.jwt.JsonWebToken decrypt(String token, String secret) throws ParseException
Parse JWT token. The token will be decrypted and converted toJsonWebToken.- Parameters:
token- the JWT tokensecret- the secret. The injectedJWTAuthContextInfoconfiguration context will be reused, only its secretDecryptionkey property will be replaced will be replaced after converting this parameter toSecretKey.- Returns:
- JsonWebToken
- Throws:
ParseException- parse exception
-
parseOnly
org.eclipse.microprofile.jwt.JsonWebToken parseOnly(String token) throws ParseException
Parse an already verified signed JWT token. Use this method only if the token has been verified by the secure gateway or other systems.- Throws:
ParseException
-
-