Class JWTParser

java.lang.Object
com.auth0.jwt.impl.JWTParser
All Implemented Interfaces:
JWTPartsParser

public class JWTParser extends Object implements JWTPartsParser
  • Field Details

    • payloadReader

      private final com.fasterxml.jackson.databind.ObjectReader payloadReader
    • headerReader

      private final com.fasterxml.jackson.databind.ObjectReader headerReader
  • Constructor Details

    • JWTParser

      public JWTParser()
    • JWTParser

      JWTParser(com.fasterxml.jackson.databind.ObjectMapper mapper)
  • Method Details

    • parsePayload

      public Payload parsePayload(String json) throws JWTDecodeException
      Description copied from interface: JWTPartsParser
      Parses the given JSON into a Payload instance.
      Specified by:
      parsePayload in interface JWTPartsParser
      Parameters:
      json - the content of the Payload in a JSON representation.
      Returns:
      the Payload.
      Throws:
      JWTDecodeException - if the json doesn't have a proper JSON format.
    • parseHeader

      public Header parseHeader(String json) throws JWTDecodeException
      Description copied from interface: JWTPartsParser
      Parses the given JSON into a Header instance.
      Specified by:
      parseHeader in interface JWTPartsParser
      Parameters:
      json - the content of the Header in a JSON representation.
      Returns:
      the Header.
      Throws:
      JWTDecodeException - if the json doesn't have a proper JSON format.
    • addDeserializers

      private void addDeserializers(com.fasterxml.jackson.databind.ObjectMapper mapper)
    • getDefaultObjectMapper

      static com.fasterxml.jackson.databind.ObjectMapper getDefaultObjectMapper()
    • decodeException

      private static JWTDecodeException decodeException()
    • decodeException

      private static JWTDecodeException decodeException(String json)