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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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:
      convert in interface org.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.