gpt4 book ai didi

wcf - 找不到 'System.IdentityModel.Tokens.UserNameSecurityToken' token 类型的 token 验证器。

转载 作者:行者123 更新时间:2023-12-04 18:45:26 28 4
gpt4 key购买 nike

我正在尝试让第三方 Java 客户端与我编写的 WCF 服务进行通信。

收到消息时出现如下异常:

Cannot find a token authenticator for the 'System.IdentityModel.Tokens.UserNameSecurityToken' token type. Tokens of that type cannot be accepted according to current security settings.

这是我的配置:

绑定(bind)

<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>

有人知道这是什么原因吗?

最佳答案

这是因为在某处使用了错误的证书引用方式,如果我没记错的话,您要么直接引用证书,要么使用 key 标识符 - 无论如何,要超越它,您应该能够添加 allowSerializedSigningTokenOnReply 标记到您的客户端绑定(bind)配置上的安全标签并将其设置为 true。

应该为你超越它 - 记住,把这个客户端放在一边

抱歉,我找不到引用资料 - 我记得在某处读过它,但现在找不到! :( ****编辑这里是**** - http://webservices20.blogspot.co.uk/2010/10/wcf-cannot-find-token-authenticator.html

<customBinding>  
<binding name="TestSecureBinding">
<security allowSerializedSigningTokenOnReply="true" />
etc
</binding>
<customBinding>

关于wcf - 找不到 'System.IdentityModel.Tokens.UserNameSecurityToken' token 类型的 token 验证器。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12637921/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com