Package org.flowable.ui.common.security
Class FlowableOAuth2GrantedAuthoritiesMapper
- java.lang.Object
-
- org.flowable.ui.common.security.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 withSCOPE_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 Summary
Fields Modifier and Type Field Description protected StringauthoritiesAttributeprotected Collection<org.springframework.security.core.GrantedAuthority>defaultAuthoritiesprotected StringgroupsAttribute
-
Constructor Summary
Constructors Constructor Description FlowableOAuth2GrantedAuthoritiesMapper(String authoritiesAttribute, String groupsAttribute, Collection<String> defaultAuthorities, Collection<String> defaultGroups)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<String>asStringCollection(Object value)protected org.springframework.security.oauth2.core.user.OAuth2UserAuthoritygetOAuth2UserAuthority(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)Collection<? extends org.springframework.security.core.GrantedAuthority>mapAuthorities(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
-
-
-
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:
mapAuthoritiesin interfaceorg.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper
-
asStringCollection
protected Collection<String> asStringCollection(Object value)
-
getOAuth2UserAuthority
protected org.springframework.security.oauth2.core.user.OAuth2UserAuthority getOAuth2UserAuthority(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
-
-