Asp.net WCF服务身份验证使用System.Web.ApplicationServices.AuthenticationService,我可以';t向成员资格提供程序进行身份验证
我正在尝试使用身份验证服务和我的成员资格提供程序进行身份验证。理想情况下,我想打电话给我的会员服务提供商,但在打电话给我的提供商之前,我会先打个电话。表示无法验证令牌。检查我的错误日志,似乎我正在尝试使用Windows auth进行身份验证。那不是我打算做的。这是一个带有svc文件的网站。我使用svcUtil并从WSDL生成客户机。我在使用客户端的应用程序中有一个测试页面。它只是一个测试页面,不会被部署。我看到集成Windows身份验证在IIS中被选中,这似乎不正确,但如果我取消选中它,Visual Studio将不会进行调试。不管怎样,我在事件日志中看到两个错误Asp.net WCF服务身份验证使用System.Web.ApplicationServices.AuthenticationService,我可以';t向成员资格提供程序进行身份验证,asp.net,wcf,authentication,forms-authentication,membership-provider,Asp.net,Wcf,Authentication,Forms Authentication,Membership Provider,我正在尝试使用身份验证服务和我的成员资格提供程序进行身份验证。理想情况下,我想打电话给我的会员服务提供商,但在打电话给我的提供商之前,我会先打个电话。表示无法验证令牌。检查我的错误日志,似乎我正在尝试使用Windows auth进行身份验证。那不是我打算做的。这是一个带有svc文件的网站。我使用svcUtil并从WSDL生成客户机。我在使用客户端的应用程序中有一个测试页面。它只是一个测试页面,不会被部署。我看到集成Windows身份验证在IIS中被选中,这似乎不正确,但如果我取消选中它,Visu
Logon Failure:
Reason: Unknown user name or bad password
User Name: sandagtestuser
Domain:
Logon Type: 8
Logon Process: Advapi
Authentication Package: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
Workstation Name: SDD-CK
Logon attempt by: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
Logon account: sandagtestuser
Source Workstation: SDD-CK
Error Code: 0xC0000064
下面是web.config中的绑定。请注意,我正在尝试使用SSL和HTTPS。这是我第一次尝试WCF安全
<system.serviceModel>
<client>
<endpoint address="https://SDD-CK/ATISServices/Services/AuthService.svc/AuthService"
binding="basicHttpBinding" bindingConfiguration="userHttps_AuthenticationService"
contract="AuthenticationService" name="userHttps_AuthenticationService" >
</endpoint>
</client>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<behaviors>
<serviceBehaviors>
<behavior name="ATISServices.AuthServiceBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="userHttps_AuthenticationService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="true" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportWithMessageCredential">
<transport proxyCredentialType="None" clientCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="basic_auth_config">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ATISServices.AuthServiceBehavior"
name="System.Web.ApplicationServices.AuthenticationService">
<endpoint binding="basicHttpBinding" bindingName="userHttps" bindingConfiguration="basic_auth_config"
bindingNamespace="http://asp.net/ApplicationServices/v200"
contract="System.Web.ApplicationServices.AuthenticationService"
address="AuthService"/>
<endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration=""
contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
在这一点上的任何帮助或提示将不胜感激。我已经为此奋斗了两天。我也在使用证书。我用“makecert”工具做的。一个是证书颁发机构,另一个是使用该颁发机构的“本地主机”证书。我还使用了httpcfg并将证书指纹设置为端口9307,但是当我在服务地址上放置“:9307”时,我得到了主动拒绝的连接。我真的很感激这里的任何帮助
干杯,~ck在圣地亚哥这确实让它起了作用。将其添加到服务行为中
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="MembershipProvider" membershipProviderName="KCMembershipProvider"/>
</serviceCredentials>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="MembershipProvider" membershipProviderName="KCMembershipProvider"/>
</serviceCredentials>