我开发了一个 MVC 应用程序,它使用 ASP.NET 成员资格提供程序建立在表单例份验证之上。
同一服务器还包含一个 WCF 应用程序,该应用程序指向与 MVC 应用程序相同的数据库(包括所有 aspnet 表)。
我想检查用户在服务中属于哪些组。
如何将凭据从 MVC 应用程序传递到 WCF 应用程序?
最佳答案
好吧,你也可以
看一下这个
[Speaking of membership providers] Windows Communication Foundation (WCF) developers can take advantage of these features for security purposes. When integrated into an WCF application, users must supply a user name/password combination to the WCF client application. To transfer the data to the WCF service, use a binding that supports user name/password credentials, such as the WSHttpBinding (in configuration, the wsHttpBinding Element) and set the client credential type to UserName. On the service, WCF security authenticates the user based on the user name and password, and also assigns the role specified by the ASP.NET role.
That's the article containing configuration samples
希望我了解您的需求。
关于.net - 将 ASP.NET 成员身份凭据从 MVC 应用程序传递到 WCF 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9524081/