-
Notifications
You must be signed in to change notification settings - Fork 65
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
DataContext incorrectly passed to UserContext? #45
Comments
yes. but nothing about GraphQL.EntityFramework forces u to take that approach. what u place in the graphql context, and how u read from it is up to u. So at my current client we have this model for the user context
then in the graphql controller we do
then we have some helper extension methods
which enables a query like this
|
Hi Simon, Thank you for the ultra-quick response :) GraphQL.Validation.ValidationError: You are not authorized to run this mutation.\nRequired claim 'role' with any value of 'Admin' is not present. When I set a breakpoint on my: I can see that the User object has the correct claims, and my ValidationRule is being populated. Many thanks. |
|
closing this for now |
Hi Simon,
By passing the DataContext in on the UserContext, does this make it impossible to use authentication?
(such as nuget GraphQL.Authorization).
I am trying to implement JWT claims based authorisation, which needs to be able to access the claims via the UserContext but this happens to contain our db context instead.
Thoughts?
Many thanks,
Jeremy
The text was updated successfully, but these errors were encountered: