Package ir.msob.jima.security.commons
Class JwtReactiveRoleConverter
java.lang.Object
ir.msob.jima.security.commons.JwtReactiveRoleConverter
- All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,reactor.core.publisher.Flux<org.springframework.security.core.GrantedAuthority>>
public class JwtReactiveRoleConverter
extends Object
implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,reactor.core.publisher.Flux<org.springframework.security.core.GrantedAuthority>>
Converts JWT to a Flux of GrantedAuthority based on the roles present in the JWT claims.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<org.springframework.security.core.GrantedAuthority> convert(org.springframework.security.oauth2.jwt.Jwt jwt) Converts a JWT into a Flux of 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
-
JwtReactiveRoleConverter
public JwtReactiveRoleConverter()
-
-
Method Details
-
convert
public reactor.core.publisher.Flux<org.springframework.security.core.GrantedAuthority> convert(org.springframework.security.oauth2.jwt.Jwt jwt) Converts a JWT into a Flux of GrantedAuthority.- Specified by:
convertin interfaceorg.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,reactor.core.publisher.Flux<org.springframework.security.core.GrantedAuthority>> - Parameters:
jwt- The JSON Web Token to be converted.- Returns:
- A Flux of GrantedAuthority representing the roles extracted from the JWT.
-