Class JwtClaimsExtractor

java.lang.Object
org.zalando.logbook.core.attributes.JwtClaimsExtractor
All Implemented Interfaces:
AttributeExtractor

@API(status=EXPERIMENTAL) public final class JwtClaimsExtractor extends Object implements AttributeExtractor
Extracts a single claim from the JWT bearer token in the request Authorization header. By default, the subject claim "sub" is extracted, but you can pass an (ordered) list of claimNames to be scanned. The first claim in claimNames is then returned, or an empty attribute if no matching claim is found.
  • Constructor Details

    • JwtClaimsExtractor

      public JwtClaimsExtractor()
  • Method Details

    • extractClaims

      public Map<String,Object> extractClaims(@Nonnull HttpRequest request) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • toStringValue

      @Nonnull public String toStringValue(Object value)