Class FlowableOAuth2GrantedAuthoritiesMapper

  • All Implemented Interfaces:
    org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper

    public class FlowableOAuth2GrantedAuthoritiesMapper
    extends Object
    implements org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper
    The Spring Security default implementation prefixes the authorities with SCOPE_ and uses the scopes from OAuth2 in the authorities. However, in order to support authorities from custom attributes with need custom attributes mapper.
    Author:
    Filip Hrisafov
    See Also:
    FlowableJwtGrantedAuthoritiesMapper
    • Field Detail

      • authoritiesAttribute

        protected final String authoritiesAttribute
      • groupsAttribute

        protected final String groupsAttribute
      • defaultAuthorities

        protected final Collection<org.springframework.security.core.GrantedAuthority> defaultAuthorities
    • Constructor Detail

      • FlowableOAuth2GrantedAuthoritiesMapper

        public FlowableOAuth2GrantedAuthoritiesMapper​(String authoritiesAttribute,
                                                      String groupsAttribute,
                                                      Collection<String> defaultAuthorities,
                                                      Collection<String> defaultGroups)
    • Method Detail

      • mapAuthorities

        public Collection<? extends org.springframework.security.core.GrantedAuthority> mapAuthorities​(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
        Specified by:
        mapAuthorities in interface org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper
      • getOAuth2UserAuthority

        protected org.springframework.security.oauth2.core.user.OAuth2UserAuthority getOAuth2UserAuthority​(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)