【发布时间】:2010-09-13 13:52:56
【问题描述】:
我正在寻找一个允许在 WCF 中使用 RESTful 服务的配置文件,但我仍然希望能够“利用”成员资格提供程序以进行用户名/密码身份验证。
以下是我当前使用 basicHttp 绑定或不带 WS 安全性的 wsHttp 配置的一部分,如果使用基于 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>
【问题讨论】:
-
我认为这是一个相关的问题,我希望看到更多关于这个主题的答案,因为我目前正在寻找同样的东西。 REST 是一种风格和设计选择,不应该无法应对身份验证。
标签: wcf web-services security rest