-
Notifications
You must be signed in to change notification settings - Fork 16
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
Empty Roles #12
Comments
I've got the same issue. Any hint regarding "permission denied 403" error is highly appreciated. With the same controller role based authentication works fine using cookie authentication. Update: Ah I am sorry, I just found out. I missed the scope "roles" in my json payload! Now everything is working. @jaredcnance btw: the roles property is empty because there is no support for lazy loading in ef7 as of yet. You need to load the roles explicitly:
|
Hi @snowping , you can explain me where the change is made. I am noob. Thank you. |
@DidierVanegas sure, in order to get a proper token (including roles) you need to send x-www-form-urlencoded params to a URL e.g. http://localhost:5000/connect/token. Enclosed you'll find a postman example how to generate a token including "roles" in scope parameter. Hope it'll work out. |
@snowping thank you very much, it works now! |
For some reason
User.Roles
is empty when it reaches the controller and throws a 403 for role based authorization.But, in the controller:
Any idea how this would happen?
The text was updated successfully, but these errors were encountered: