I tried to make policy role based authorization in an aspnet core 3 app but i have error when i acces to adminsitrator authorized route with the administrator account. I don't understand why... If someone have an idea.
What is the specific error? Is the error you are experiencing on the access route of all administrators or a specific administrator?
Best Regards ,
Sherry
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Is the error you are experiencing on the access route of all administrators or a specific administrator?
I have just one administrator and other role like member ; moderator but in this case the called route use [Authorize("RequireAdministratorRole")]
and I'm logged in with this administrator account.
Member
8 Points
46 Posts
ASP.NET Core 3 simple roles based authorization
Oct 21, 2019 05:00 PM|BeRoots|LINK
I tried to make policy role based authorization in an aspnet core 3 app but i have error when i acces to adminsitrator authorized route with the administrator account. I don't understand why... If someone have an idea.
https://github.com/BeRoots/aspnetcore3-angular-spa/tree/dev
Contributor
2060 Points
606 Posts
Re: ASP.NET Core 3 simple roles based authorization
Oct 22, 2019 02:09 AM|Sherry Chen|LINK
Hi BeRoots ,
What is the specific error? Is the error you are experiencing on the access route of all administrators or a specific administrator?
Best Regards ,
Sherry
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
8 Points
46 Posts
Re: ASP.NET Core 3 simple roles based authorization
Oct 23, 2019 10:30 AM|BeRoots|LINK
Hi Sherry Chen.
The specific error is 403: http://pasteall.org/pic/show.php?id=c123b165cd67d463af622d4bd4c68f68
I have just one administrator and other role like member ; moderator but in this case the called route use [Authorize("RequireAdministratorRole")] and I'm logged in with this administrator account.
Member
8 Points
46 Posts
Re: ASP.NET Core 3 simple roles based authorization
Oct 25, 2019 06:46 PM|BeRoots|LINK
I have tested many things but still this 403 error on the road requiring authorization. If someone have an idea of the reason of the 403 error ;)
You can easly build the project from my repo (branch DEV). https://github.com/BeRoots/aspnetcore3-angular-spa/tree/dev
Thanks in advance.
Member
8 Points
46 Posts
Re: ASP.NET Core 3 simple roles based authorization
Oct 25, 2019 07:58 PM|BeRoots|LINK
Ok. Apparently it's a bug. See https://github.com/aspnet/AspNetCore.Docs/issues/14944