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
Scaffolding over existing authorization #7042
Comments
Ok, so in the first place I hade to add the AddRoles to Identity configuration Now it still doesn't work. However, it works the following construction var user = await UserManager.GetUserAsync(User); So, how come User.IsInRole does not work while UserManager.GetRolesAsync works? |
Hello @alexiordan ... did you see 👉 https://docs.microsoft.com/aspnet/core/security/authorization/roles |
Yes, but what is the actual answer to my question though? |
ping @HaoK |
Its a bug in AddDefaultIdentity/AddIdentityCore, see: aspnet/Identity#1813 |
I followed instructions "Create full identity UI source" after creation of an MVC project with authorization. I fixed it by calling .AddDefaultTokenProviders() in the ConfigureServices method like this:
|
Authentication works, but User.IsInRole("X") does not return the expected value (it worked with previous version).
Is this expected?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: