Can Forms Authentication, Role Management and Data for the website all work from a single SQL database?

本秂侑毒 提交于 2019-12-25 00:43:25

问题


With ASP.NET 4 and Forms Authentication:

Is it possible to use one database to store data for:

  • Authentication of users (Using Forms authentication)
  • Role Management (Need Admins, and Member roles with various access levels)
  • Data used throughout the webiste, user preferences etc

I read that the database used as the Authentication provider needs to follow a specific schema, does this mean no other tables and data can be added to the SQL Database being used, or just that the tables storing data required for authentication need to be specific?


回答1:


Yes, it is completely possible. All you need to do is run the script to register the required tables in your database.

This is easy to do using the ASP.NET SQL Server Registration Tool

The other data tables do not have to follow any specific schema and will not conflict with your ASP.NET tables unless you introduce some problematic data table relationships.




回答2:


If you use default providers from ASP .NET they use predefined database schema but you can create your own providers which access database with their own way.




回答3:


Yes you can use the same database you only need create cutom Role and Membership Providers so that you only have that data that is needed for you and not whole Aps.net default database



来源:https://stackoverflow.com/questions/5323785/can-forms-authentication-role-management-and-data-for-the-website-all-work-from

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!