尝试使用活动WIF点击我的RP WCF服务并接收此错误。我启用了WIF跟踪,它产生了:
Microsoft.IdentityModel.Tokens.FailedAuthenticationFaultException,Microsoft.IdentityModel,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 ID3242:无法对安全令牌进行身份验证或授权。
我用谷歌搜索了这个并做了很多推荐的事情here。我还将我的audienceUris模式设置为false。这是我的配置:
<microsoft.identityModel>
<service name="TestService">
<audienceUris mode="Never">
<add value="https://localhost:9080/XdsService/XDSRegistry" />
</audienceUris>
<!-- For Security Assertion Markup Language (SAML) and X.509 token authentication, you must implement an IssuerNameRegistry -->
<issuerNameRegistry type="Microsoft.IHE.XDS.Common.Federated.CustomIssuerNameRegistry, Microsoft.IHE.XDS.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<claimsAuthorizationManager type="Microsoft.IHE.XDS.Common.Federated.CustomClaimsAuthorizationManager, Microsoft.IHE.XDS.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</service>
我甚至创建了自己的ClaimsAuthorizationManager和IssuerNameRegistry来调试这个......