2

I have a simple task to accomplish, I am creating an application that has two types of users, Admins and Users.

I looked at this: ASP.NET MVC 3 Areas and multiple authentication in web.config

And it is very close to what I need to do.

So the simple question is how do you have different login schemes using Forms Authentication in different areas on an MVC site?

1

1 Answer 1

3

putting security attributes in web.config many not be the best thing to do as explained by the post How can we set authorization for a whole area in ASP.NET MVC?. Please consider applying attributes at the controller level eg

[Authorize(Roles = "User, Administrator")]

or

[Authorize(Roles = "User")]

or

[Authorize(Roles = "User, Administrator")]

Happy Coding

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.