类 HerodotusJwtGrantedAuthoritiesConverter
java.lang.Object
cn.herodotus.stirrup.oauth2.authorization.converter.HerodotusJwtGrantedAuthoritiesConverter
- 所有已实现的接口:
org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>>
public class HerodotusJwtGrantedAuthoritiesConverter
extends Object
implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>>
Description: Jwt 权限数据转换器
- 作者:
- : gengwei.zheng
- Date:
- : 2022/3/13 14:21
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Collection<org.springframework.security.core.GrantedAuthority> convert(org.springframework.security.oauth2.jwt.Jwt jwt) ExtractGrantedAuthoritys from the givenJwt.voidsetAuthoritiesClaimName(String authoritiesClaimName) Sets the name of token claim to use for mappingauthoritiesby this converter.voidsetAuthorityPrefix(String authorityPrefix) Sets the prefix to use forauthoritiesmapped by this converter.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.springframework.core.convert.converter.Converter
andThen
-
构造器详细资料
-
HerodotusJwtGrantedAuthoritiesConverter
public HerodotusJwtGrantedAuthoritiesConverter()
-
-
方法详细资料
-
convert
public Collection<org.springframework.security.core.GrantedAuthority> convert(org.springframework.security.oauth2.jwt.Jwt jwt) ExtractGrantedAuthoritys from the givenJwt.- 指定者:
convert在接口中org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,Collection<org.springframework.security.core.GrantedAuthority>> - 参数:
jwt- TheJwttoken- 返回:
- The
authoritiesread from the token scopes
-
setAuthorityPrefix
Sets the prefix to use forauthoritiesmapped by this converter. Defaults to- 参数:
authorityPrefix- The authority prefix- 从以下版本开始:
- 5.2
-
setAuthoritiesClaimName
Sets the name of token claim to use for mappingauthoritiesby this converter. Defaults to- 参数:
authoritiesClaimName- The token claim name to map authorities- 从以下版本开始:
- 5.2
-