springboot-rsocketjwt-example icon indicating copy to clipboard operation
springboot-rsocketjwt-example copied to clipboard

Mutli-Tenancy Support using JWT claims

Open InventorSingh opened this issue 5 years ago • 0 comments

Hi Greg, Thank you for the great work. I was trying this example and trying to add mutli-tenancy support in spring boot hello world application from netifi examples. I am using netifi community edition broker.

Below is my Rsocket Security Configuration:

@Configuration @EnableRSocketSecurity public class RsocketSecurityConfig {

@Bean
PayloadSocketAcceptorInterceptor rsocketInterceptor(RSocketSecurity rsocket) {
    return rsocket
            .authorizePayload(authorize ->
                    authorize
                            .route("*").hasRole("ROLE_ADMIN")
                            .anyRequest().authenticated()
                            .anyExchange().authenticated()
            )
            .jwt(Customizer.withDefaults()).build();
}

@Bean
ReactiveJwtDecoder jwtDecoder() {
    return ReactiveJwtDecoders
            .fromIssuerLocation("http://localhost:7475/auth/realms/devnation");
}

}

But somehow security is not applied to my application. I am still able to call the hello-service form hello-client. How could I secure my services defined in protobuff with spring security rsocket?

InventorSingh avatar Mar 20 '20 15:03 InventorSingh