5
In my system I need to have two types of authentication one for common user who will register and etc.. and another for the administrator my question is how I differentiate the two authentication using Formsauthentication, I believe that will have some conflict for example when I save the values in:
FormsAuthentication.SetAuthCookie(user.UserName, model.RememberMe);
I looked for some examples on Google but I was not very successful! I understood more or less that it would be necessary to create different rules.
Anything will be welcome! examples, links, articles ...
For example when I put the [Authorize] attribute in my action how it will know which type of user it will authorize?
– Tuyoshi Vinicius
Which version of your Aspnetmvc ? has a solution yes !!! will only depend on the version itself!
– user6026
I’m using Aspnetmvc 4! @Crood can pass some link or example of how to do this?
– Tuyoshi Vinicius
take a look at this project https://github.com/cleytonferrari/LoginMemberShip has a practical example of
CustomRules
– Tafarel Chicotti
Just one more detail I need both users to have independent sessions being possible to exist both at the same time! you can do this with Customrules ?
– Tuyoshi Vinicius
Yes because in my project the "Administrator" Entity is different from the "User" entity and both will have access to different intefaces! I think if both users will have access to different interfaces in the system, maybe the solution is to create another project in the same Solution for the administrative part?
– Tuyoshi Vinicius