using Windows integrated authentication with SqlRoleProvider in silverlight application

爱⌒轻易说出口 提交于 2019-12-05 13:19:14

We've done exactly this in our application, you have to create your own RoleProvider and then specify that in your web.config. Then you can load your roles from whatever source you like.

<roleManager enabled="true" defaultProvider="MyRoleProvider">
    <providers>
        <clear />
        <add name="MyRoleProvider" type="MyCompany.MyRoleProvider, MyAssembly" />
    </providers>
</roleManager>

RoleProvider http://msdn.microsoft.com/en-us/library/system.web.security.roleprovider.aspx

grabah

BenCr is right. But I wanted to avoid creating my own role provider and wanted to be able to add users with ease (through the Visual Studio built-in ASP.NET configuration tool)

So I found this on the net and it works. It ended up to being much simpler than I thought. You just enable roles in web config file, Together with Windows Integrated Authentication. Copy your local mdf file (and attach it to sql server) and it works.

http://weblogs.asp.net/scottgu/pages/Recipe_3A00_-Implementing-Role_2D00_Based-Security-with-ASP.NET-2.0-using-Windows-Authentication-and-SQL-Server.aspx

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