java.lang.Object
org.bremersee.spring.security.oauth2.server.resource.authentication.JsonPathJwtConverter
All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>

public class JsonPathJwtConverter extends Object implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>
The json path jwt converter.
Author:
Christian Bremer
  • Constructor Details

    • JsonPathJwtConverter

      public JsonPathJwtConverter(JsonPathJwtProperties properties)
      Instantiates a new Json path jwt converter.
      Parameters:
      properties - the properties
  • Method Details

    • convert

      public @NonNull NormalizedJwtAuthenticationToken convert(@NonNull org.springframework.security.oauth2.jwt.Jwt source)
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,org.springframework.security.authentication.AbstractAuthenticationToken>
    • getGrantedAuthorities

      protected Collection<? extends org.springframework.security.core.GrantedAuthority> getGrantedAuthorities(JsonPathJwtParser parser)
      Gets groups.
      Parameters:
      parser - the parser
      Returns:
      the groups
    • getAuthoritiesFromList

      protected Stream<String> getAuthoritiesFromList(JsonPathJwtParser parser)
      Gets authorities from list.
      Parameters:
      parser - the parser
      Returns:
      the authorities from list
    • getAuthoritiesFromValue

      protected Stream<String> getAuthoritiesFromValue(JsonPathJwtParser parser)
      Gets authorities from value.
      Parameters:
      parser - the parser
      Returns:
      the authorities from value
    • getGroups

      protected Collection<Group> getGroups(JsonPathJwtParser parser)
      Gets groups.
      Parameters:
      parser - the parser
      Returns:
      the groups
    • getGroupsFromList

      protected Stream<String> getGroupsFromList(JsonPathJwtParser parser)
      Gets groups from list.
      Parameters:
      parser - the parser
      Returns:
      the groups from list
    • getGroupsFromValue

      protected Stream<String> getGroupsFromValue(JsonPathJwtParser parser)
      Gets groups from value.
      Parameters:
      parser - the parser
      Returns:
      the groups from value
    • getUsername

      protected String getUsername(org.springframework.security.oauth2.jwt.Jwt source, JsonPathJwtParser parser)
      Gets username.
      Parameters:
      source - the source
      parser - the parser
      Returns:
      the username
    • getFirstName

      protected String getFirstName(JsonPathJwtParser parser)
      Gets first name.
      Parameters:
      parser - the parser
      Returns:
      the first name
    • getLastName

      protected String getLastName(JsonPathJwtParser parser)
      Gets last name.
      Parameters:
      parser - the parser
      Returns:
      the last name
    • getEmail

      protected String getEmail(JsonPathJwtParser parser)
      Gets email.
      Parameters:
      parser - the parser
      Returns:
      the email