Class JwtGrantedAuthoritiesConverter

  • All Implemented Interfaces:
    org.springframework.core.convert.converter.Converter<Jwt,​java.util.Collection<GrantedAuthority>>

    public final class JwtGrantedAuthoritiesConverter
    extends java.lang.Object
    implements org.springframework.core.convert.converter.Converter<Jwt,​java.util.Collection<GrantedAuthority>>
    Extracts the GrantedAuthoritys from scope attributes typically found in a Jwt.
    Since:
    5.2
    • Constructor Detail

      • JwtGrantedAuthoritiesConverter

        public JwtGrantedAuthoritiesConverter()
    • Method Detail

      • setAuthorityPrefix

        public void setAuthorityPrefix​(java.lang.String authorityPrefix)
        Sets the prefix to use for authorities mapped by this converter. Defaults to DEFAULT_AUTHORITY_PREFIX.
        Parameters:
        authorityPrefix - The authority prefix
        Since:
        5.2
      • setAuthoritiesClaimName

        public void setAuthoritiesClaimName​(java.lang.String authoritiesClaimName)
        Sets the name of token claim to use for mapping authorities by this converter. Defaults to WELL_KNOWN_AUTHORITIES_CLAIM_NAMES.
        Parameters:
        authoritiesClaimName - The token claim name to map authorities
        Since:
        5.2