开发者

pass user credentials from aspnet site to wcf service

开发者 https://www.devze.com 2023-02-06 15:19 出处:网络
How do I pass user credentials from aspnet site to wcf service? Without impersonating. (web site must be executed by a specific user)

How do I pass user credentials from aspnet site to wcf service?

  • Without impersonating. (web site must be executed by a specific user)
  • Without knowing the callers password.
  • Only passing some kind of mystic security context.

Both开发者_JS百科 website and WCF service use logon with windows/NTLM: authentication mode="Windows"

WCF service using: binding="wsHttpBinding"

IIS 7.5. 2 servers (2008r2).

website code behind (current - passing credentials for user which executes website):

protected void btSend_Click(object sender, EventArgs e)
{
  FunctionWhichCanOnlyBeCalledByASpecificUser();
  MyService.MyServiceClient s = new MyService.MyServiceClient();
  s.SendMyMessage(tbMessage.Text);
}


In many cases you can use ASP.NET Compatibility Mode just add this line to your config:

 <system.serviceModel>        
      <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />    
 </system.serviceModel>

Reference

0

精彩评论

暂无评论...
验证码 换一张
取 消