Class RSocketConfiguration

java.lang.Object
ir.msob.jima.security.api.kafka.oauth2.RSocketConfiguration

@Configuration public class RSocketConfiguration extends Object
Configuration class for setting up RSocket-specific configurations related to security and message handling in a Spring application using OAuth2 for authentication.

This class provides bean definitions for configuring JWT (JSON Web Token) authentication for RSocket communication, including the authentication manager and RSocket message handler.

Usage: Include this configuration class in your application's configuration to enable RSocket security with OAuth2-based JWT authentication.

Since:
0.1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.oauth2.server.resource.authentication.JwtReactiveAuthenticationManager
    jwtReactiveAuthenticationManager(org.springframework.security.oauth2.jwt.ReactiveJwtDecoder decoder, JwtRoleConverter jwtRoleConverter)
    Bean definition for JwtReactiveAuthenticationManager.
    org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler
    messageHandler(org.springframework.messaging.rsocket.RSocketStrategies strategies)
    Bean definition for RSocketMessageHandler.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RSocketConfiguration

      public RSocketConfiguration()
  • Method Details

    • jwtReactiveAuthenticationManager

      @Bean public org.springframework.security.oauth2.server.resource.authentication.JwtReactiveAuthenticationManager jwtReactiveAuthenticationManager(org.springframework.security.oauth2.jwt.ReactiveJwtDecoder decoder, JwtRoleConverter jwtRoleConverter)
      Bean definition for JwtReactiveAuthenticationManager.
      Parameters:
      decoder - The ReactiveJwtDecoder for decoding JWTs.
      jwtRoleConverter - The JwtRoleConverter for converting JWT roles to authorities.
      Returns:
      An instance of JwtReactiveAuthenticationManager configured with the provided decoder and converter.
    • messageHandler

      @Bean public org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler messageHandler(org.springframework.messaging.rsocket.RSocketStrategies strategies)
      Bean definition for RSocketMessageHandler.
      Parameters:
      strategies - The RSocketStrategies to be used by the message handler.
      Returns:
      An instance of RSocketMessageHandler configured with the provided strategies.