.net - 将 ASP.NET 成员身份凭据从 MVC 应用程序传递到 WCF 应用程序

标签 .net asp.net-mvc wcf wcf-security

我开发了一个 MVC 应用程序,它使用 ASP.NET 成员资格提供程序建立在表单例份验证之上。

同一服务器还包含一个 WCF 应用程序,该应用程序指向与 MVC 应用程序相同的数据库(包括所有 aspnet 表)。

我想检查用户在服务中属于哪些组。

如何将凭据从 MVC 应用程序传递到 WCF 应用程序?

最佳答案

好吧,你也可以

  • 在 MVC 应用程序上开发任何类型的 API,以便 WCF 应用程序与之交互(这将允许您将来在任何地方部署这两个东西),
  • 尝试让 WCF 服务使用成员资格提供程序进行身份验证,并将 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/

    相关文章:

    c# - .net 通用类型对象转换为与其所持有的类型不同的类型

    c# - 获取文件名而不是 Controller 名称

    .net - 使用 Asp.net mvc 以编程方式创建 Azure 服务总线

    c# WCF REST 用于参数和验证的强类型 WebGet 对象

    wcf - 解决方案中的多个 WCF 项目与单个项目

    c# - 如何使用反射调用泛型方法?

    c# - 控制音量混合器

    asp.net-mvc - 在 MVC2 中的 EditorForModel 与 DisplayForModel 模式中显示不同的字段

    c# - 在 WCF REST 服务方法中获取 TLS 客户端证书

    .net - 设计问题 POCO 对象/DAL 访问