Support for Reactive Method Security #1333
-
Hi, I am setting up oauth2 login for my project. Everything works fine until it comes to method-level security. The Reactor's Context seems not to be integrated, therefore PreAuthorize cannot determine the current user role. I also tried to use GraphQLContext to gain access to the Reactor's Context, but it also does not work. I have done some research but have not yet found any reliable information/examples regarding authorization for graphql-kotlin. It would be great if we could do method-level security as usual. I'm using My simplified SecurityConfig looks like this:
My sample queries:
My custom FunctionDataFetcher:
In contrast, Method-level security works in the context of Rest Controller, for example:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
TLDR we rely on |
Beta Was this translation helpful? Give feedback.
TLDR we rely on
graphql-java
execution logic which is based onCompletableFuture
and is unaware of any reactive context. You have to do workarounds as suggested in #1300