简体   繁体   English

WCF 来自 MVC App 的服务认证共享相同的会员提供者

[英]WCF Service Authentication from MVC App sharing same Membership Provider

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.我在 X 域上有一个 MVC 应用程序,在 Y 域中有一个 WCF 服务,我想对它们使用相同的成员资格提供程序。

The WCF Service is in Y domain because the data is in an intr.net 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. WCF 服务在 Y 域中,因为数据在 intr.net 服务器中,而 MVC 应用程序在 X 域中,因为我不想处理我们服务器上生成数据的所有请求。

I want the user to login to the MVC Application and by doing so also authenticating to the WCF Service.我希望用户登录到 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).我不知道最好的方法是什么,如果我可以在 MVC 应用程序中验证时为这两件事创建 cookies(我不确定如何完成)。 I don't want my WCF Service be available to anyone who's not authenticated.我不希望任何未通过身份验证的人都可以使用我的 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 来验证用户,然后将相同的用户名和密码传递给我的自定义 WCF 服务以便能够与之交互。

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.问题是我使用 AuthenticationService 验证我的用户名并创建一个 cookie( http://msdn.microsoft.com/en-us/library/bb515342.aspx )但是当我与我的自定义 WCF 服务(数据)交互时我需要再次提供用户名和密码( http://msdn.microsoft.com/en-us/library/ff647294.aspx ),我对用户名没有问题,但密码我不知道如何管理它,我不知道每次都想输入密码。

Is there something easier?有什么更容易的吗?

Check the link below.检查下面的链接。 Your scenario is fully covered and explained.您的方案已完全涵盖和解释。 http://msdn.microsoft.com/en-us/library/bb386582.aspx http://msdn.microsoft.com/en-us/library/bb386582.aspx

Hope that helps.希望有所帮助。

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

相关问题 从客户端访问WCF服务SQL成员资格提供程序 - Accessing WCF service sql membership provider from client WCF服务中的ASP.NET成员身份验证 - ASP.NET Membership Authentication in WCF service 是否可以从wcf服务或桌面应用程序完全访问sql成员资格提供程序? - Is it possible to have full access to sql membership provider from wcf service or desktop application? 使用ASP.NET成员资格提供程序的WCF身份验证 - WCF authentication using ASP.NET Membership Provider WCF服务授权到没有成员资格提供程序的服务功能 - WCF Services Authorisation to a service function without membership provider 具有成员资格提供程序身份验证的WCF WebHttpBinding - WCF WebHttpBinding with Membership provider authetication 从安全Web应用到WCF数据服务的身份验证呼叫挂起 - Authentication call from secure web app to WCF data service hangs 从同一服务器上的MVC调用WCF服务时出现SocketException - SocketException when calling WCF service from MVC on same server 来自MYSQL成员资格提供程序的自定义成员资格提供程序 - Custom membership provider from MYSQL Membership Provider 如何在ASP.Net MVC应用程序中使用来自WCF身份验证服务的身份验证cookie - How to use authentication cookie from WCF Authentication Service in an ASP.Net MVC application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM