Class JsonPathJwtConverter

  • All Implemented Interfaces:
    org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,​org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken>

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

      • JsonPathJwtConverter

        public JsonPathJwtConverter()
    • Method Detail

      • setRolesJsonPath

        public void setRolesJsonPath​(String rolesJsonPath)
        Sets roles json path.
        Parameters:
        rolesJsonPath - the roles json path
      • setRolesValueList

        public void setRolesValueList​(boolean rolesValueList)
        Sets roles value list.
        Parameters:
        rolesValueList - the roles value list
      • setRolesValueSeparator

        public void setRolesValueSeparator​(String rolesValueSeparator)
        Sets roles value separator.
        Parameters:
        rolesValueSeparator - the roles value separator
      • setRolePrefix

        public void setRolePrefix​(String rolePrefix)
        Sets role prefix.
        Parameters:
        rolePrefix - the role prefix
      • setNameJsonPath

        public void setNameJsonPath​(String nameJsonPath)
        Sets name json path.
        Parameters:
        nameJsonPath - the name json path
      • convert

        @NonNull
        public org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken 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.oauth2.server.resource.authentication.JwtAuthenticationToken>