简体   繁体   English

如何使用托管的应用程序池标识

[英]How to use hosted application pool identity

I have a WCF RESTful service, it is hosted on IIS 7. I am using webHttpBinding binding with the WCF service. 我有一个WCF RESTful服务,该服务托管在IIS 7上。我正在将webHttpBinding与WCF服务一起使用。

This service is having a application pool for which I specified a custom account identity(I specified user name & password) 该服务有一个应用程序池,我为其指定了自定义帐户标识(我指定了用户名和密码)

Anonymous access is enabled for the WCF service. 为WCF服务启用了匿名访问。

From inside the WCF service code I want to make a HttpWebRequest to another server. 从WCF服务代码内部,我想向另一个服务器发出HttpWebRequest。 But I want to use the same context (identity) under which my application pool is running. 但是我想使用运行我的应用程序池的相同上下文(身份)。

How can I achieve it, do I need to use impersonation for this? 我如何实现它,我需要为此使用模拟吗? or is there any better way for it. 还是有更好的方法

Annu 安努

只需将HttpWebRequestUseDefaultCredentials属性设置为true

Depends on if the other service supports Windows Authentication. 取决于其他服务是否支持Windows身份验证。 If it does then you can either 如果可以,那么您可以

 request.UseDefaultCredentials = true;

or 要么

 request.Credentials = CredentialCache.DefaultNetworkCredentials; 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序池标识更改 - application pool identity change 如何使HttpClient使用应用程序池标识 - How to make HttpClient to use the app pool identity 以编程方式获取应用程序池标识 - Get the Application Pool Identity programmatically 如何正确设置IIS 7应用程序池标识? - How to set up IIS 7 application pool identity correctly? 当我更改 IIS 应用程序池身份用户使用自定义帐户时,它会停止应用程序池,即使我再次启动它也是如此 - When I Change the IIS Application Pool Identity User Use Custom Account it stops the Application pool even if I start it again 由于应用程序池标识,连接到TfsTeamProjectCollection失败 - Connecting to TfsTeamProjectCollection fails due to Application Pool Identity HttpWebRequest、TLS 和应用程序池服务标识 - HttpWebRequest, TLS and application pool service identity Identity Server 4具有在Mvc应用程序中托管的社交登录名 - Identity Server 4 With Social Login Hosted In Mvc Application ServerManager,正在创建应用程序池,未设置身份 - ServerManager, Creating application pool, identity not set 更改应用程序池的标识时出错 - Error while changing identity for application pool
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM