1
0
mirror of synced 2026-08-05 17:57:15 +00:00

Document Reactive Method security requires Publisher return types

Fixes: gh-4988
This commit is contained in:
Rob Winch
2018-02-07 16:31:41 -06:00
parent ea3dd336aa
commit 964a14b224
5 changed files with 26 additions and 0 deletions
+6
View File
@@ -1718,6 +1718,12 @@ For additional information about methods that can be overridden, refer to the `G
Spring Security supports method security using https://projectreactor.io/docs/core/release/reference/#context[Reactor's Context] which is setup using `ReactiveSecurityContextHolder`.
For example, this demonstrates how to retrieve the currently logged in user's message.
[NOTE]
====
For this to work the return type of the method must be a `org.reactivestreams.Publisher` (i.e. `Mono`/`Flux`).
This is necessary to integrate with Reactor's `Context`.
====
[source,java]
----
Authentication authentication = new TestingAuthenticationToken("user", "password", "ROLE_USER");