简体   繁体   English

使用WCF服务的Asp.Net Web应用程序身份验证

[英]Asp.Net Web Application authentication using WCF Service

I have a WCF service which is repsonsible for authenticating users . 我有一个WCF服务,负责对用户进行身份验证。 Unlike WCF Authentication Services , I want all authentication (including the ones from a asp.net web application) to happen at the WCF service layer . 与WCF身份验证服务不同,我希望所有身份验证(包括来自asp.net Web应用程序的身份验证)都在WCF服务层进行。

Now, my query , should I be defining membership providers for authentication at the web application tier.Say , for eg, I define a custom WCF memebership provider that calls the WCF service to carry out authentication. 现在,我的查询应该在Web应用程序层定义身份验证的成员资格提供程序。例如,我定义一个自定义WCF成员身份提供程序,该提供程序调用WCF服务以执行身份验证。 or If the application uses forms authentication for authenticating users against a active directory , I would use a Active directory membership provider at the Web Tier. 或如果应用程序使用表单身份验证来针对活动目录对用户进行身份验证,那么我将在Web层上使用活动目录成员资格提供程序。

As per my logic , since I want the WCF service to be repsonsible for authenticating users from different applications , I would define the membership providers at the service layer . 按照我的逻辑,由于我希望WCF服务能够对来自不同应用程序的用户进行身份验证,因此我将在服务层定义成员资格提供程序。

However , there are difference in opinion as to which layer is responsible for implementing the membership provider . 但是,关于哪个层负责实施成员资格提供程序存在意见分歧。

Thansk & Regards Girija 坦斯克·里贾斯(Girija)

You can't (and should not) perform, let's say, Windows authentication for asp.net application in WCF. 假设您不能(也不应)对WCF中的asp.net应用程序执行Windows身份验证。 Nor should you make your service responsible for determining which authentication uses asp.net. 你也不应该让你的服务负责确定身份验证使用asp.net。

In short, you should define your authentication mechanism at application level (although you can implement it at any level you want). 简而言之,您应该在应用程序级别定义身份验证机制(尽管您可以在所需的任何级别实现它)。

And by the way I would recommend you using already established federation protocols (ie, WIF) for handling authenticaion between several applications. 顺便提一下,我建议您使用已经建立的联合协议(即WIF)来处理多个应用程序之间的身份验证。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM