使用域用户从IIS验证SQL [英] Use Domain User to Authenticate SQL from IIS

查看:128
本文介绍了使用域用户从IIS验证SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个SQL Server实例,它对我的​​LAN中的不同域用户(组)具有不同的写/读权限。

目前,我正在开发一个使用Windows身份验证的Intranet ASP.NET应用程序。

但是,当我尝试通过应用程序连接SQL时,它显示此错误

I have this SQL Server instance which has different write/read permission for different Domain Users (Groups) in my LAN.
Currently, I am developing an Intranet ASP.NET Application which uses Windows Authentication.
But, When I tried to connect the SQL through Application, It shows this error

Login failed for user 'DOMAIN\SERVER_NAME$'. 



我是否可以使用相同的登录域权限连接SQL Server,

或者我可以在不打开的情况下登录SQL Server我的SQL Server上的SQL Server身份验证?


Can I use the same logged in Domain permission to connect the SQL Server,
or Can I log in to the SQL Server without switching on 'SQL Server Authentication' on my SQL Server ?

推荐答案

'。



我是否可以使用相同的登录域权限连接SQL Server,

或者我可以在不打开的情况下登录SQL Server我的SQL Server上的SQL Server身份验证?


Can I use the same logged in Domain permission to connect the SQL Server,
or Can I log in to the SQL Server without switching on 'SQL Server Authentication' on my SQL Server ?


您需要启用模拟:

在ASP.NET模拟中使用IIS身份验证 [ ^ ]

You need to enable impersonation:
Using IIS Authentication with ASP.NET Impersonation[^]
<configuration>
  <system.web>
    <identity impersonate="true" />
  </system.web>
</configuration>





如果SQL与IIS不在同一台服务器上,则需要执行其他配置 - 特别是,确保IIS服务器受信任以进行委派,并且您使用的是Kerberos而不是NTLM 。



双跳问题清单{IIS和SQL Server} [ ^ ]

如何:在ASP.NET 2.0中使用Windows身份验证连接到SQL Server [ ^ ]





If SQL is not on the same server as IIS, you will need to perform additional configuration - in particular, make sure the IIS server is trusted for delegation, and that you're using Kerberos instead of NTLM.

Checklist for Double Hop issues {IIS and SQL Server}[^]
How To: Connect to SQL Server Using Windows Authentication in ASP.NET 2.0[^]



确保您的应用程序服务器设置为值得信赖的代表团。在IIS中确保禁用匿名身份验证并启用Windows身份验证,如果使用Windows 2008,也启用ASP.Net模拟。如果使用Windows 2008并且您的应用程序池在网络服务下运行,则转到Windows身份验证的高级设置并关闭内核模式。将yourDomain \ yourAppServer


Ensure your Application server is set as Trusted for Delegation. Ensure in IIS that Anonymous Authentication is disabled and Windows Authentication is enabled, if using Windows 2008, enable ASP.Net Impersonation also. If using Windows 2008 and your app pool is running under Network Service then goto Advanced settings of Windows Authentication and turn Kernal Mode off. Set yourDomain\yourAppServer


设置为对ASP.Net应用程序文件夹具有读取权限。

to have read access to the ASP.Net application folder.





如果仍然无法使其工作,则可能需要从Windows切换到基本身份验证:



If you still can't get it to work, you might need to switch from Windows to Basic authentication:



在IIS中,只有基本身份验证使用通过网络流向远程SQL服务器的安全令牌来登录用户。默认情况下,与身份配置元素设置结合使用的其他IIS安全模式不会生成可以对远程SQL Server进行身份验证的令牌。


In IIS, only Basic Authentication logs users on with a security token that flows across the network to a remote SQL server. By default, other IIS security modes used in conjunction with the identity configuration element settings will not result in a token that can authenticate to a remote SQL Server.

这篇关于使用域用户从IIS验证SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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