Skip to content
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

Authorize(Roles="Admin") -attribute not working #30

Closed
yonzo opened this issue Mar 13, 2017 · 4 comments
Closed

Authorize(Roles="Admin") -attribute not working #30

yonzo opened this issue Mar 13, 2017 · 4 comments

Comments

@yonzo
Copy link

yonzo commented Mar 13, 2017

When decorating my controller methods with i.e.:
Autorize(Roles="Admin")
I get the 404-errormessage "Not found".

If I remove Roles="Admin", it's all good (as long as the user has logged in of course).
I might be missing some fundamental stuff here, but if so - please enlighten me! :-)

Regards,
Yonzo

@g0t4
Copy link
Owner

g0t4 commented Mar 13, 2017 via email

@yonzo
Copy link
Author

yonzo commented Mar 14, 2017

Ok, thanks - I'll look into it some more...

@yonzo yonzo closed this as completed Mar 14, 2017
@nohwnd
Copy link

nohwnd commented Sep 18, 2017

@yonzo This is caused by missing Role claim on the user. Identity framework uses claims for authorization by default now, so to achieve this your jwt token provider (or cookie provider) must add Role claim with value 'Admin' to the token.

@JonSomNor
Copy link

Thanks a lot nohwnd!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants