我正在寻找一个允许在 WCF 中使用 RESTful 服务的配置文件,但我仍然希望能够“利用”成员资格提供程序以进行用户名/密码身份验证。
以下是我当前使用 basicHttp 绑定(bind)或不带 WS 安全性的 wsHttp 配置的一部分,这将如何改 rebase 于 REST 的服务?
<bindings>
<wsHttpBinding>
<binding name="wsHttp">
<security mode="TransportWithMessageCredential">
<transport/>
<message clientCredentialType="UserName" negotiateServiceCredential="false" establishSecurityContext="false"/>
</security>
</binding>
</wsHttpBinding>
<basicHttpBinding>
<binding name="basicHttp">
<security mode="TransportWithMessageCredential">
<transport/>
<message clientCredentialType="UserName"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="NorthwindBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceAuthorization principalPermissionMode="UseAspNetRoles"/>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="MembershipProvider"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
最佳答案
这是一个关于使用 ASP.net 成员提供程序保护 WCF REST 服务的播客:
http://channel9.msdn.com/posts/rojacobs/endpointtv-Securing-RESTful-services-with-ASPNET-Membership/
关于wcf - 如何使用用户名/密码 + SSL 使用 WCF 配置安全 RESTful 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/141484/