Package org.flowable.ui.common.security
Class FlowableJwtGrantedAuthoritiesMapper
- java.lang.Object
-
- org.flowable.ui.common.security.FlowableJwtGrantedAuthoritiesMapper
-
- All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>>
public class FlowableJwtGrantedAuthoritiesMapper extends Object implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>>
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:
FlowableOAuth2GrantedAuthoritiesMapper
-
-
Field Summary
Fields Modifier and Type Field Description protected StringauthoritiesAttributeprotected Collection<org.springframework.security.core.GrantedAuthority>defaultAuthoritiesprotected org.springframework.security.oauth2.server.resource.authentication.JwtGrantedAuthoritiesConverterdefaultConverterprotected StringgroupsAttribute
-
Constructor Summary
Constructors Constructor Description FlowableJwtGrantedAuthoritiesMapper(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)Collection<org.springframework.security.core.GrantedAuthority>convert(org.springframework.security.oauth2.jwt.Jwt jwt)voidsetDefaultConverter(org.springframework.security.oauth2.server.resource.authentication.JwtGrantedAuthoritiesConverter defaultConverter)
-
-
-
Field Detail
-
authoritiesAttribute
protected final String authoritiesAttribute
-
groupsAttribute
protected final String groupsAttribute
-
defaultAuthorities
protected final Collection<org.springframework.security.core.GrantedAuthority> defaultAuthorities
-
defaultConverter
protected org.springframework.security.oauth2.server.resource.authentication.JwtGrantedAuthoritiesConverter defaultConverter
-
-
Constructor Detail
-
FlowableJwtGrantedAuthoritiesMapper
public FlowableJwtGrantedAuthoritiesMapper(String authoritiesAttribute, String groupsAttribute, Collection<String> defaultAuthorities, Collection<String> defaultGroups)
-
-
Method Detail
-
convert
public Collection<org.springframework.security.core.GrantedAuthority> convert(org.springframework.security.oauth2.jwt.Jwt jwt)
- Specified by:
convertin interfaceorg.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>>
-
asStringCollection
protected Collection<String> asStringCollection(Object value)
-
setDefaultConverter
public void setDefaultConverter(org.springframework.security.oauth2.server.resource.authentication.JwtGrantedAuthoritiesConverter defaultConverter)
-
-