Class ClaimsMapper


  • public final class ClaimsMapper
    extends Object
    Utility class for converting Claims and Claim objects to and from JSON.
    • Method Detail

      • asJsonString

        public static String asJsonString​(Claims claims)
                                   throws com.fasterxml.jackson.core.JsonProcessingException
        Returns the Claims as a json string.
        Parameters:
        claims - the Claims object to convert
        Returns:
        The Claims as a json string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - if the claims object does not represent valid JSON.
      • asJsonValue

        public static JsonValue asJsonValue​(Claims claims)
        Returns the Claims as a map with keys of id_token, userinfo, and any custom claims.
        Parameters:
        claims - the Claims object to convert
        Returns:
        The Claims as a map
      • parse

        public static Claims parse​(String claims)
                            throws JsonException
        Parses incoming claims string.
        Parameters:
        claims - The claims string
        Returns:
        The parsed Claims
        Throws:
        JsonException - If the claims string could not be parsed