在Silverlight应用程序中使用Windows集成身份验证与SqlRoleProvider [英] using Windows intergrated authentication with SqlRoleProvider in silverlight application

查看:126
本文介绍了在Silverlight应用程序中使用Windows集成身份验证与SqlRoleProvider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Web应用程序,该应用程序要求将用户置于角色中,并根据其角色给予不同的权限。这可以通过使用Forms Authentication和SqlRoleProvider轻松完成。但是,应用程序将在企业内部网内部使用,并且表单身份验证会强制用户在每次要使用应用程序时手动登录。使用Windows集成的autenthification看起来更优雅,因为用户已经登录企业域。但是这里的角色存在问题,默认情况下集成身份验证使用在用户Windows帐户(组成员资格等等)中构建的角色。我的应用程序要求我将用户置于自定义角色中。因此,就角色而言,拥有数据库i控制是更有利的解决方案。
有没有办法使用Windows集成身份验证(用于身份验证)和SqlRoleProvider(用于角色和用户管理)?

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)?

推荐答案

BenCr是对的。但我想避免创建自己的角色提供程序,并希望能够轻松添加用户(通过Visual Studio内置的ASP.NET配置工具)

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)

所以我在网上发现了这个并且它有效。它最终变得比我想象的要简单得多。
您只需在Web配置文件中启用角色,与Windows集成身份验证一起使用。复制你的本地mdf文件(并将其附加到sql server),它可以工作。

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

这篇关于在Silverlight应用程序中使用Windows集成身份验证与SqlRoleProvider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆