Search code examples
windowssilverlightiis-7wcf-ria-services

using Windows integrated authentication with SqlRoleProvider in silverlight application


I am working on web application that requires that users are put into roles and are given different permissions based on their roles. This can be easily done by using Forms Authentication and SqlRoleProvider. But, application will be used internally within corporate intranet, and forms authentication forces users to manually login every time they want to use application, Using Windows integrated autenthification looks much more elegant, since users are already logged on corporate domain. But there is a problem with roles here, integrated authentication by default uses roles that are built in users windows accounts (group membership and so on..). My application requires that i put users into custom made roles. So as far as roles are concerned having database i control is much more favorable solution. Is there a way to use Windows integrated authentification (for authentification) together with SqlRoleProvider (for roles and user management)?


Solution

  • 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