Skip to content

Implemented Add Kotlin example for SecuritySocketAcceptorInterceptor o… #10936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion docs/modules/ROOT/pages/reactive/integrations/rsocket.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,27 @@ Doing so connects our `PayloadSocketAcceptorInterceptor` with the RSocket infras
In a Spring Boot application, you can do this automatically by 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]]
Expand Down