hamid
11/17/2021, 9:43 AMSpringSubscriptionGraphQLContextFactory
but this didn't work too because there is no security context available there. I tried coroutineContext[ReactorContext]
and ReactiveSecurityContextHolder.getContext()
but both of them returns null. My question is how can I get the SecurityContext
in this context factory and populate it in GraphqlContext
because it is needed for authorisation in our AuthorizationDataFetcher
?@WithMockUser
annotation but the context is null in runtime.Nikky
11/17/2021, 12:00 PMSpringGraphQLContextFactory<SpringGraphQLContext>
and implement generateContext
(should switch to generateContexctMap
eventually..)
grabbing header with
val authHeader = request.headers().firstHeader("Authorization")
we then parse the headers and instantiate a securityContext, subclass of SpringGraphQLContext
and our own security context class
i did not find any way to reuse security context from a webfilter doing authorization or the like .. that would be cleanerhamid
11/17/2021, 12:09 PMShane Myrick
11/17/2021, 9:24 PMhamid
11/18/2021, 1:39 PM