Skip to content

Commit

Permalink
Add Kotlin example for SecuritySocketAcceptorInterceptor of RSocket
Browse files Browse the repository at this point in the history
Closes gh-10932
  • Loading branch information
Lijamaija authored and eleftherias committed Mar 9, 2022
1 parent 93d4fd3 commit bc2bb8c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/modules/ROOT/pages/reactive/integrations/rsocket.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,30 @@ For Spring Security to work we need to apply `SecuritySocketAcceptorInterceptor`
This is what connects our `PayloadSocketAcceptorInterceptor` we created with the RSocket infrastructure.
In a Spring Boot application this is done automatically using `RSocketSecurityAutoConfiguration` with the following code.

[source,java]
====
.Java
[source,java,role="primary"]
----
@Bean
RSocketServerCustomizer springSecurityRSocketSecurity(SecuritySocketAcceptorInterceptor interceptor) {
return (server) -> server.interceptors((registry) -> registry.forSocketAcceptor(interceptor));
}
----
.Kotlin
[source,kotlin,role="secondary"]
----
@Bean
fun springSecurityRSocketSecurity(interceptor: SecuritySocketAcceptorInterceptor): RSocketServerCustomizer {
return RSocketServerCustomizer { server ->
server.interceptors { registry ->
registry.forSocketAcceptor(interceptor)
}
}
}
----
====

[[rsocket-authentication]]
== RSocket Authentication

Expand Down

0 comments on commit bc2bb8c

Please sign in to comment.