Interface JWTProcessor<C extends SecurityContext>

  • All Known Subinterfaces:
    ConfigurableJWTProcessor<C>
    All Known Implementing Classes:
    DefaultJWTProcessor

    public interface JWTProcessor<C extends SecurityContext>
    Interface for parsing and processing unsecured (plain), signed and encrypted JSON Web Tokens (JWTs). An optional context parameter is available to facilitate passing of additional data between the caller and the underlying JOSE processor (in both directions).
    Version:
    2015-08-20
    Author:
    Vladimir Dzhuvinov
    • Method Detail

      • process

        JWTClaimsSet process​(JWT jwt,
                             C context)
                      throws BadJOSEException,
                             JOSEException
        Processes the specified JWT (unsecured, signed or encrypted).
        Parameters:
        jwt - The JWT. Must not be null.
        context - Optional context, null if not required.
        Returns:
        The JWT claims set on success.
        Throws:
        BadJOSEException - If the JWT is rejected.
        JOSEException - If an internal processing exception is encountered.
      • process

        JWTClaimsSet process​(PlainJWT plainJWT,
                             C context)
                      throws BadJOSEException,
                             JOSEException
        Processes the specified unsecured (plain) JWT, typically by checking its context.
        Parameters:
        plainJWT - The unsecured (plain) JWT. Not null.
        context - Optional context, null if not required.
        Returns:
        The JWT claims set on success.
        Throws:
        BadJOSEException - If the unsecured (plain) JWT is rejected, after examining the context or due to the payload not being a JSON object.
        JOSEException - If an internal processing exception is encountered.
      • process

        JWTClaimsSet process​(SignedJWT signedJWT,
                             C context)
                      throws BadJOSEException,
                             JOSEException
        Processes the specified signed JWT by verifying its signature. The key candidate(s) are selected by examining the JWS header and / or the message context.
        Parameters:
        signedJWT - The signed JWT. Not null.
        context - Optional context, null if not required.
        Returns:
        The JWT claims set on success.
        Throws:
        BadJOSEException - If the signed JWT is rejected, typically due to a bad signature or the payload not being a JSON object.
        JOSEException - If an internal processing exception is encountered.
      • process

        JWTClaimsSet process​(EncryptedJWT encryptedJWT,
                             C context)
                      throws BadJOSEException,
                             JOSEException
        Processes the specified encrypted JWT by decrypting it. The key candidate(s) are selected by examining the JWS header and / or the message context.
        Parameters:
        encryptedJWT - The encrypted JWT. Not null.
        context - Optional context, null if not required.
        Returns:
        The JWT claims set on success.
        Throws:
        BadJOSEException - If the encrypted JWT is rejected, typically due to failed decryption or the payload not being a JSON object.
        JOSEException - If an internal processing exception is encountered.