Class ConfigurableClaimSet2AuthoritiesConverter
java.lang.Object
com.c4_soft.springaddons.security.oauth2.config.ConfigurableClaimSet2AuthoritiesConverter
- All Implemented Interfaces:
OAuth2AuthoritiesConverter,org.springframework.core.convert.converter.Converter<Map<String,Object>, Collection<? extends org.springframework.security.core.GrantedAuthority>>
public class ConfigurableClaimSet2AuthoritiesConverter
extends Object
implements OAuth2AuthoritiesConverter
Portable converter to extract Spring-security authorities from OAuth2 claims.
It is designed to work with SpringAddonsSecurityProperties which enable to configure:
- source claims (which claims to pick authorities from, dot.separated.path is supported)
- for each claim: prefix (should anything like "ROLE_" or "PREFIX_" be pre-pended to authorities)
- for each claim: case transformation (should be authorities be forced to uppercase, lowercase or be left untouched)
- Author:
- ch4mp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends org.springframework.security.core.GrantedAuthority>Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.convert.converter.Converter
andThen
-
Constructor Details
-
ConfigurableClaimSet2AuthoritiesConverter
public ConfigurableClaimSet2AuthoritiesConverter()
-
-
Method Details
-
convert
public Collection<? extends org.springframework.security.core.GrantedAuthority> convert(Map<String, Object> source) - Specified by:
convertin interfaceorg.springframework.core.convert.converter.Converter<Map<String,Object>, Collection<? extends org.springframework.security.core.GrantedAuthority>>
-