SQL Server 2008 R2上配置ASP.NET MVC应用程序的IIS 7.5应用程序池标识作为登录 [英] Configuring ASP.NET MVC app's IIS 7.5 Application Pool identity as login on SQL Server 2008 R2

查看:130
本文介绍了SQL Server 2008 R2上配置ASP.NET MVC应用程序的IIS 7.5应用程序池标识作为登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图SQL Server上使用IIS 7.5的应用程序池身份登录2008 R2,使我的ASP.NET Web应用程序可以连接到数据库...

<一个href=\"http://stackoverflow.com/questions/454497/iis7-sql-2008-and-asp-net-mvc-security/1031774#1031774\">Using这种方法我的本地开发机器上工作的罚款(IIS 7.5和SQL Server 2008 R2的同一台机器上)。

然而,当我尝试设置在同一生产(IIS和SQL服务器是分开的),我无法添加IIS APPPOOL \\ MyAppAppPool登录到SQL Server 2008 R2。

请注意,在这两种情况下,你不能使用浏览...创建以来在SQL Server登录时,IIS APPPOOL \\ MyAppAppPool用户身份是动态的(或特殊)...

任何想法?

更新:

有关应用程序池标识更多信息请参见这里

从文章:


  

每当一个新的应用程序池
  创建时,IIS管理过程
  创建一个安全标识符(SID)
  那些重新presents的名字
  应用程序池本身。例如,
  如果您创建一个应用程序池
  名称为MyNewAppPool,安全
  标识符与该名
  MyNewAppPool在创建
  Windows安全系统。由此
  点上,资源可以由被固定
  使用这个身份。然而,
  身份是不是一个真正的用户帐户;
  它不会出现在该用户
  Windows用户管理控制台。



解决方案

这条规定(访问网络下的),你仍然使用&LT;域名&GT; \\&LT;计算机名&GT; $ 又名域中的计算机帐户。

因此​​,如果两个服务器都在foobar的领域和Web盒子是自行车,用于SQL Server实例的登录是 foobar的\\自行车$

如果您不是在一个域中,再有就是进行身份验证没有共同的目录中。使用SQL登录用户名和密码为简单

编辑,评论后

如果域是可信的,那么你可以使用machien账号还是(用于SQL Server使用域本地组,在其中添加一个全局组等)

对于使用应用程序池的身份,他们只是依照第本地Web服务器。他们没有任何意义到SQL Server。如果您需要区分网站,然后使用适当的域帐户的应用程序池。

您不能两者兼得...

I am trying to use IIS 7.5 Application Pool identity as login on SQL Server 2008 R2 so that my ASP.NET web app can connect to the database...

Using this approach worked fine on my local dev machine (IIS 7.5 and SQL Server 2008 R2 on same machine).

However, when I try to set up the same on production (IIS and SQL servers are separate) I am unable to add "IIS APPPOOL\MyAppAppPool" login to SQL Server 2008 R2.

Notice that in either case you cannot use "Browse..." when creating a login in SQL Server since "IIS APPPOOL\MyAppAppPool" user identity is dynamic (or "special")...

Any ideas?

Update:

For more info on Application Pool Identities see here.

From article:

Whenever a new Application Pool is created, the IIS management process creates a security identifier (SID) that represents the name of the Application Pool itself. For example, if you create an Application Pool with the name "MyNewAppPool," a security identifier with the name "MyNewAppPool" is created in the Windows Security system. From this point on, resources can be secured by using this identity. However, the identity is not a real user account; it will not show up as a user in the Windows User Management Console.

解决方案

That articles states (under "Accessing the Network") you still use the <domainname>\<machinename>$ aka machine account in the domain.

So if both servers are in "foobar" domain, and the web box is "bicycle", the login used to the SQL Server Instance is foobar\bicycle$

If you aren't in a domain, then there is no common directory to authenticate against. Use a SQL login with username and password for simplicity

Edit, after comment

If the domains are trusted then you can use the machien account still (use domain local groups for SQL Server, into which add a global groups etc)

As for using app pool identities, they are local to your web server only as per article. They have no meaning to SQL Server. If you need to differentiate sites, then use proper domain accounts for the App Pools.

You can't have it both ways...

这篇关于SQL Server 2008 R2上配置ASP.NET MVC应用程序的IIS 7.5应用程序池标识作为登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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