简体   繁体   中英

Authentication and authorization in ASP.NET MVC 4

I have I am making a web application in ASP.NET MVC 4 and I was wondering what authentication and authorization mechanism to use. I'll only use a SQL server to store credentials and I won't need any third party logins like Facebook, Google, etc. So I was thinking is Forms Authentication good enough for this requirement?

Thanks in advance.

I would suggest SimpleMembership, which ships by default in a new MVC project, so it is ready to use. If you want disable the Facebook, Google from it - you can simply remove the respective modules from the AccountController. SimpleMembership is also good to know, as it handles nicely how eg different roles of users can have different level of access to your app.

http://weblogs.asp.net/jongalloway/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates

The caveat that you would need to keep in mind is that likely the way you will setup your context, is that there will be a separate database for your business logic, different than the one used by default for the membership. So ultimately for production you will like to merge these 2 together. Here is some article that gives some insight to this topic.

How can i change the default database for simple membership tables

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM