A Custom Membership Provider *Without* a Database?

守給你的承諾、 提交于 2019-12-02 12:30:13

You should be able to create a custom SimpleRoleProvider and plug it into your application by modifying the web.config to something like this:

<add name="SimpleRoleProvider" type="MyCustomRoleProvider.SimpleRoleProvider, MyCustomRoleProvider"/>

Where MyCustomRoleProvider is the name of the assembly that contains your implementation of SimpleRoleProvider.

Then just rip out the initialization for SimpleMembership. This article describes how to simplify the initialization process for SimpleMembership. Basically remove the InitializeSimpleMembership attribute from the AccountController and move the initialization to the Global.asax Application_Start method. But in your case you would want to add any initialization required for your custom SimpleRoleProvider, if there is any required.

For the implementation your are describing you will most likely have to also create a custom SimpleMembershipProvider.

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