Interface JWTParser

  • All Known Implementing Classes:
    DefaultJWTParser

    public interface JWTParser
    A parser to parse a JWT token and convert it to a JsonWebToken.
    • 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 to JsonWebToken. This method depends on the injected JWTAuthContextInfo configuration 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 to JsonWebToken.
        Parameters:
        token - the JWT token
        context - the configuration context which will override the injected JWTAuthContextInfo configuration 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 to JsonWebToken.
        Parameters:
        token - the JWT token
        key - the public verification key. The injected JWTAuthContextInfo configuration 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 to JsonWebToken.
        Parameters:
        token - the JWT token
        key - the secret verification key. The injected JWTAuthContextInfo configuration 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 to JsonWebToken.
        Parameters:
        token - the JWT token
        secret - the secret. The injected JWTAuthContextInfo configuration context will be reused, only its secretVerificationKey property will be replaced after converting this parameter to SecretKey.
        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 to JsonWebToken.
        Parameters:
        token - the JWT token
        key - the private decryption key. The injected JWTAuthContextInfo configuration 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 to JsonWebToken.
        Parameters:
        token - the JWT token
        key - the secret decryption key. The injected JWTAuthContextInfo configuration 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 to JsonWebToken.
        Parameters:
        token - the JWT token
        secret - the secret. The injected JWTAuthContextInfo configuration context will be reused, only its secretDecryptionkey property will be replaced will be replaced after converting this parameter to SecretKey.
        Returns:
        JsonWebToken
        Throws:
        ParseException - parse exception