Class JWTParser

    • Field Detail

      • payloadReader

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

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

      • JWTParser

        public JWTParser()
      • JWTParser

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

      • parsePayload

        public Payload parsePayload​(java.lang.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​(java.lang.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​(java.lang.String json)