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

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

问题描述

我正在研究Web应用程序,该应用程序要求将用户置于角色中,并根据其角色赋予不同的权限.通过使用窗体身份验证和SqlRoleProvider,可以轻松完成此操作.但是,应用程序将在公司Intranet内部内部使用,并且通过表单身份验证强制用户每次要使用应用程序时都手动登录.使用Windows集成增强功能看起来更加优雅,因为用户已经在公司域中登录.但是这里的角色存在问题,默认情况下,集成身份验证使用在用户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.

查看全文

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