-
Notifications
You must be signed in to change notification settings - Fork 44
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
Access User/Roles in GraphQL #264
Comments
Adding some context to @frisi's issue above: we're trying to make this work with Kotlin coroutines, using Expedia's
I was able to implement a ExecutionInput.Builder executionInputBuilder = ExecutionInput.newExecutionInput()
.query(invocationData.getQuery())
.operationName(invocationData.getOperationName())
.variables(invocationData.getVariables()); Please take a look and let me know if this is something you would consider putting on your roadmap. Furthermore, if you could give me some context about doing this the correct way, I would be happy to contribute to the project :) |
Feature description
I'd like to limit usage of certain GraphQL queries or mutations to certain roles and also access user- and role related information (eg via
SecuirtyService
bean) within functions exposed via GraphQL.Currently this seems to be impossible or at least undocumented (i did not find a section/example in the docs)
There is an open (and for > 1 year unanswered) issue for supporting the
@Secured
annotation. (this blogpost seems to (partly) solve this problem)There is also another ticket outlining how to access request information.
I used this approach to extract authentication information (duplicating logic of a custom
AuthenticationFetcher
) from the request and inject it into mutation parameters within aDataFetcherFactoryProvider
viamapParameterToValue
.A nicer way would be to have a possibility to inject
SecurityService
but it seems request scope beans currently do not really work in the context of GraphQLThe text was updated successfully, but these errors were encountered: