我正在嘗試讓第三方Java客戶端與我寫的WCF服務進行通信。無法找到「System.IdentityModel.Tokens.UserNameSecurityToken」令牌類型的令牌認證程序。
無法找到的 「System.IdentityModel.Tokens.UserNameSecurityToken」令牌類型的令牌認證:
我收到郵件時出現以下情況例外。根據當前安全 設置,該類型的令牌 不能被接受。
這裏是我的配置:
綁定
<customBinding>
<binding name="TestSecureBinding">
<security authenticationMode="MutualCertificate" />
<textMessageEncoding messageVersion="Soap11WSAddressing10" />
<httpsTransport requireClientCertificate="true" maxReceivedMessageSize="5242880" />
</binding>
</customBinding>
行爲:
<serviceBehaviors>
<behavior name="TestCertificateBehavior">
<serviceCredentials>
<clientCertificate>
<certificate storeLocation="LocalMachine" x509FindType="FindBySubjectName" findValue="Test 01"/>
<authentication certificateValidationMode="PeerTrust" trustedStoreLocation="LocalMachine" revocationMode="NoCheck"/>
</clientCertificate>
<serviceCertificate storeLocation="LocalMachine" x509FindType="FindBySubjectName" findValue="Test 01"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
端點:
<service name="TestService"
behaviorConfiguration="TestCertificateBehavior">
<endpoint
name="TestEndpoint"
address="https://localhost:443"
contract="TestServiceContract"
binding="customBinding"
bindingConfiguration="TestSecureBinding">
</endpoint>
<host>
<baseAddresses>
<add baseAddress="https://localhost:443" />
</baseAddresses>
</host>
</service>
有誰知道這是什麼原因造成的?
我認爲這特別修復了'System.IdentityModel.Tokens.X509SecurityToken'異常,但不是'System.IdentityModel.Tokens.UserNameSecurityToken'問題。 – Fenton
當得到'System.IdentityModel.Tokens.X509SecurityToken'異常時,這對我無效:/ –