Class DelegatingJwtGrantedAuthoritiesConverter
- java.lang.Object
-
- org.springframework.security.oauth2.server.resource.authentication.DelegatingJwtGrantedAuthoritiesConverter
-
- All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,java.util.Collection<org.springframework.security.core.GrantedAuthority>>
public class DelegatingJwtGrantedAuthoritiesConverter extends java.lang.Object implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,java.util.Collection<org.springframework.security.core.GrantedAuthority>>AJwttoGrantedAuthorityConverterthat is a composite of converters.- Since:
- 5.5
- See Also:
JwtGrantedAuthoritiesConverter
-
-
Constructor Summary
Constructors Constructor Description DelegatingJwtGrantedAuthoritiesConverter(java.util.Collection<org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,java.util.Collection<org.springframework.security.core.GrantedAuthority>>> authoritiesConverters)DelegatingJwtGrantedAuthoritiesConverter(org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,java.util.Collection<org.springframework.security.core.GrantedAuthority>>... authoritiesConverters)Constructs aDelegatingJwtGrantedAuthoritiesConverterusing the provided array ofConverters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<org.springframework.security.core.GrantedAuthority>convert(org.springframework.security.oauth2.jwt.Jwt jwt)ExtractGrantedAuthoritys from the givenJwt.
-
-
-
Constructor Detail
-
DelegatingJwtGrantedAuthoritiesConverter
public DelegatingJwtGrantedAuthoritiesConverter(java.util.Collection<org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,java.util.Collection<org.springframework.security.core.GrantedAuthority>>> authoritiesConverters)
- Parameters:
authoritiesConverters- theCollectionofConverters to use
-
DelegatingJwtGrantedAuthoritiesConverter
@SafeVarargs public DelegatingJwtGrantedAuthoritiesConverter(org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,java.util.Collection<org.springframework.security.core.GrantedAuthority>>... authoritiesConverters)
Constructs aDelegatingJwtGrantedAuthoritiesConverterusing the provided array ofConverters- Parameters:
authoritiesConverters- the array ofConverters to use
-
-
Method Detail
-
convert
public java.util.Collection<org.springframework.security.core.GrantedAuthority> convert(org.springframework.security.oauth2.jwt.Jwt jwt)
ExtractGrantedAuthoritys from the givenJwt.The authorities are extracted from each delegated
Converterone at a time. For each converter, its authorities are added in order, with duplicates removed.- Specified by:
convertin interfaceorg.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,java.util.Collection<org.springframework.security.core.GrantedAuthority>>- Parameters:
jwt- TheJwttoken- Returns:
- The
authoritiesread from the token scopes
-
-