I'm developing an ASP.NET Core 6 web application.
I'd like to use Role based authorization where I can do
[Authorize(Roles ="Admin")]
public class IndexModel : PageModel
I've read about Claims-based authorization and cookie authentication and creating an Identity User, but not sure how to implement it. Plus the machine account username for both KioskAdmin and KioskUser is going to be different for every machine the application is eventually deployed on.
Is there a way to tie [Authorize(Roles ="Admin")]
to some custom method where I implement my own code/logic and return some value that would signal the Authorization was valid?
I found something that works for me. Implement custom Authorize attribute. custom AuthorizeAttribute in ASP.NET Core
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments