本文介绍了ASP.NET - > WCF服务要求Windows身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在负责构建一个基本的管理应用。
该应用程序需要一个ASP.NET前端,其中谈到了一些使用WCF后端服务。

I've been tasked with building a basic admin app.The app needs an ASP.NET front end which talks to a number of back end services using WCF.

一个要求是应用程序的用户正在使用Windows身份验证身份验证。如果应用程序逻辑是包含在ASP.NET应用程序,我可以做这没有问题,但我不知道如何将后端WCF服务中进行认证?

One requirement is that the users of the app are authenticated using Windows authentication. I can do this no problem if the app logic were contained in the ASP.NET app, but I have no idea how to perform authentication within the back end WCF services?


  • 是否有可能通过对WCF服务传递凭据,并把它执行身份验证?

推荐答案

这取决于...(请注意其中的大部分是基于作为传输的HTTP / IIS,可能是不同的,如果使用TCP或其他绑定)

It depends... (Note most of this is based on HTTP/IIS as the transport, could be different if using TCP or other bindings)

WCF本身可以设置使用当前运行的凭据使用传输或消息的安全性。

WCF itself can be setup to use Transport or Message security using the current running credentials.

如果WCF服务(它需要使用当前凭据谈论任何东西)是在同一个盒子作为ASP> NET前端的你可能会确定

If the WCF service (and anything it needs to talk with using the current credential) is on the same box as the ASP>NET front end you will probably be ok

...否则你可能会走向认证的麻烦。基本上Windows验证就可以了解哪些是本地优良的网络服务器的模拟的身份,但它并没有权限关闭身份验证的Web服务器。要做到这一点,你需要一个代表团的身份。

...otherwise you could be heading for "Double Hop Authentication" trouble. Basically windows auth will get an "impersonation" identity on the webserver which is fine locally, but it does not have permission authenticate off of the web server. To do that you need a "delegation" identity.

这是我所知道的获取代表团身份的选项是Kerberos和基本验证。

The options that I am aware of for getting a delegation identity are Kerberos and Basic Authentication.

所以,如果当你说windows身份验证你真的是每个人(客户端和所有服务器)都在同一个AD域,你可能确定。

So if when you say "windows authentication" you really mean everyone (client and all servers) are on the same AD domain you might ok.

这篇关于ASP.NET - > WCF服务要求Windows身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 08:08
查看更多