SQL Server和ASP.NET中的窗口身份验证 [英] Window authentication in sql server and asp.net

查看:91
本文介绍了SQL Server和ASP.NET中的窗口身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为asp.net Web应用程序使用Windows数据库的Windows身份验证.但是,当我将网站部署到另一台计算机后,我无法连接到数据库.是否有用于窗口身份验证的任何属性来设置用户名和web.config文件中的密码.

I am using Window Authentication for sql database for my asp.net web application.but after i deploy my website to another computer I'm unable to connect to the database.Is there any property for window authentication to set user name and password in web.config file.

推荐答案

这听起来像您的情况吗?

Does this sound like your scenario?

  • 在本地计算机上构建的IIS Web应用
  • Web应用使用Windows身份验证
  • Web应用程序也在本地计算机上与数据库对话
  • Web应用程序用户还具有有效的数据库登录名
  • Web应用程序用户凭据通过受信任的连接传递到数据库

一切正常.然后将其移至另一个环境,在该环境中数据库和IIS不再位于同一服务器上,然后您无法使数据库识别IIS传入的凭据?

Everything works great. Then you move it to a different environment where the database and IIS are no longer on the same server and then you cannot get the database to recognize the credentials IIS is passing in?

如果是这样,那么几个月前欢迎来到我的地狱.问题在于,一旦两个进程不在同一个盒子中,它们就不再相互信任.需要两个网络管理权限才能使两个进程跨服务器边界相互信任.不幸的是,我没有写博客,但总体步骤是

If so, then welcome to my hell a few months ago. The problem is that once the two processes are not on the same box, they don't trust each other any more. Network administration permissions are required to get the two process to trust each other across server boundaries. Unfortunately, I didn't blog about it but the general steps were

  • 将IIS服务帐户标记为可信任(Active Directory设置)
  • 将服务主体名称(SPN)设置为netbios名称或FQDN
  • 必须在两个方框中都设置一些内容,以表明它们可以相互信任

很抱歉,我的回忆含糊不清,因为我不是拥有修复任何内容的凭据的人,所以我只能观察到它们单击了按钮.如何使用Windows身份验证连接到SQL Server 相当远的地方.

Sorry for the vague recollection and as I wasn't the one with credentials to fix anything, I only got to observe them clicking the buttons. The starting article on How to connect to SQL Server using Windows Authentication got us fairly far down the track.

这篇关于SQL Server和ASP.NET中的窗口身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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