Class ConfigurableClaimSetAuthoritiesConverter
java.lang.Object
com.c4_soft.springaddons.security.oidc.starter.ConfigurableClaimSetAuthoritiesConverter
- All Implemented Interfaces:
ClaimSetAuthoritiesConverter,org.springframework.core.convert.converter.Converter<Map<String,Object>, Collection<? extends org.springframework.security.core.GrantedAuthority>>
public class ConfigurableClaimSetAuthoritiesConverter
extends Object
implements ClaimSetAuthoritiesConverter
Portable converter to extract Spring-security authorities from OAuth2 claims.
It relies on OpenidProviderPropertiesResolver to resolve the configuration properties for
the provided claims (and throws if it is not resolved). This properties 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
-
ConfigurableClaimSetAuthoritiesConverter
public ConfigurableClaimSetAuthoritiesConverter()
-
-
Method Details
-
convert
public Collection<? extends org.springframework.security.core.GrantedAuthority> convert(@NonNull Map<String, Object> source) - Specified by:
convertin interfaceorg.springframework.core.convert.converter.Converter<Map<String,Object>, Collection<? extends org.springframework.security.core.GrantedAuthority>>
-