从MVC应用程序WCF服务的身份验证共享相同的成员资格提供 [英] WCF Service Authentication from MVC App sharing same Membership Provider

查看:125
本文介绍了从MVC应用程序WCF服务的身份验证共享相同的成员资格提供的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有X上域和Y轴域MVC应用程序中WCF服务,我想使用相同的成员提供对他们俩的。

I have an MVC Application on X domain and a WCF Service in Y domain, and I want to use the same membership provider for both of them.

WCF服务是Y轴域,因为该数据是在Intranet服务器,MVC应用程序是X中域,因为我不想来处理我们的服务器生成的数据上的所有要求。

The WCF Service is in Y domain because the data is in an intranet server, and the MVC Application is in X domain because I don't want to handle all the request on our server that generates the data.

我希望用户登录到MVC应用程序,并通过这样做也鉴定到WCF服务。

I want the user to login to the MVC Application and by doing so also authenticating to the WCF Service.

我不知道这将是这样做的最好的方式,如果我能为两件事创建cookie时,他们在MVC应用程序(这我不知道如何完成)进行身份验证。我不希望我的WCF服务提供给任何人谁不是验证。

I don't know which would be the best way to do so, if I can create cookies for both things when they authenticate in the MVC Application (which I'm not sure how to accomplish). I don't want my WCF Service be available to anyone who's not authenticated.

所以我想我需要的是的AuthenticationService来验证用户,然后传递给我的自定义WCF服务相同的用户名和密码才能进行操作。

So what I think I need is the AuthenticationService to validate the user and then pass the same username and password to my custom WCF Service to be able to interact with it.

的事情是,我确认我的用户名与和的AuthenticationService创建Cookie( HTTP ://msdn.microsoft.com/en-us/library/bb515342.aspx ),但是当我和我的自定义WCF服务(数据交互),我需要重新提供用户名和密码(的 http://msdn.microsoft.com/en-us/library/ff647294.aspx ) ,我没有问题的用户名,但是密码我不知道如何管理它,我不希望每次都被要求输入密码。

The thing is that I validate my username with AuthenticationService and create a cookie (http://msdn.microsoft.com/en-us/library/bb515342.aspx) but then when I interact with my Custom WCF Service (Data) I need to supply username and password again (http://msdn.microsoft.com/en-us/library/ff647294.aspx), I have no problem with the username but the password I'm not sure how to manage it and I don't want to be asking for the password every time.

是不是有什么更容易吗?

Is there something easier?

推荐答案

检查下面的链接。您的情况是完全覆盖和解释。
http://msdn.microsoft.com/en-us/library/bb386582.aspx

Check the link below. Your scenario is fully covered and explained. http://msdn.microsoft.com/en-us/library/bb386582.aspx

希望有所帮助。

这篇关于从MVC应用程序WCF服务的身份验证共享相同的成员资格提供的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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