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