2
I have a controller
responsible for doing the Login part, configured on web.config
to use the
<authentication mode="Forms">
<forms loginUrl="~/Usuario/Login" timeout="30" protection="All" path="/" />
</authentication>
And I wish only in a few ActionResult
was accessed by some specific users, I saw that the [Authorize(Roles="exemplo")]
meets my need, but I don’t know how I can make the code to create the profiles sessions for users, for example, administrator profile, client profile, etc. To be able to put in my Roles
.
I am using the Entity Framework and the MVC standard.
Could someone help me?
The documentation of Microsoft "Role-based Authorization in ASP.NET Core" together with some questions of Soen, "MVC Role Authorization", may solve your problem.
– João Martins