gpt4 book ai didi

sql-server - 双跳与 ASP.Net 网站和 NHibernate

转载 作者:行者123 更新时间:2023-12-04 05:41:45 25 4
gpt4 key购买 nike

背景:

ASP.Net MVC 网站。托管在 IIS7、Intranet 上。

数据库:SQL Server。通过 NHibernate 访问。
在连接字符串中,访问权限设置为 Integrated Security: SSPI .
(对 DB 的权限是基于 Active-Directory 的。)

总之,这是典型的双跳情况,
我需要将客户端的凭据传递给 IIS,并从 IIS 传递给 SQL Server。

问题:

问题是蓝屏死机,错误:Login failed for user 'MyDomain\UserThatRunsAppPool'.
我尝试解决问题的方法:

  • 将身份验证配置为仅启用 Windows 身份验证
    和 ASP.NET 模拟
  • 设置 Windows 身份验证 ProviderNegotiate:Kerberos(禁用内核模式身份验证后)
  • 确保 UserThatRunsAppPool 的委托(delegate)设置为:
    ' Trust the user for delegation to any service (Kerberos only) ' 在事件目录中
  • Application_BeginRequest() 移动 NHibernate SessionFactory 创建
    Session_Start()

  • 我尝试解决问题的成功程度:

    一点也不。

    编辑:
    我还尝试将 IIS 服务器的委托(delegate)设置为 ' Trust the user for delegation to any service (Kerberos only) '(在事件目录中)。

    最佳答案

    In short, this is a typical double-hop situation,
    where I need to pass client's credentials to IIS, and from IIS to SQL Server.

    您遇到了“委托(delegate)”问题。如果您想保持清醒,请将连接字符串更改为使用 SQL 用户名 + 密码而不是 SSPI。

    如果您觉得两周的调试和与域管理员争吵感到沮丧,请阅读 Fun with the Kerberos Delegation Web Site .

    关于sql-server - 双跳与 ASP.Net 网站和 NHibernate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11176400/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com