私は SimpleMembership モデルの初心者です。WebSecurity は Web ページでは問題なく動作しますが、サービスで使用すると問題が発生します。
私はいくつかのWebサービスを持っています。
<binding name="SecureBasicBindingWithMembershipConfig">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" />
<message clientCredentialType="UserName" />
</security>
</binding>
Web サービスからユーザー ID を復元しようとしています。
を使用するWebSecurity.IsAuthenticated
と、返されますIsAuthenticated = 'WebMatrix.WebData.WebSecurity.IsAuthenticated' threw an exception of type 'System.ArgumentNullException'
ただし、 System.Web.Security.Membership.GetUser()
ユーザー ID を使用すると正しく返されます。
WebSecurity を WCF サービス内で使用できますか? それとも何か問題がありますか?