Cannot find a token authenticator for the 'System.IdentityModel.Tokens.X509SecurityToken' token type
- Dominant language
- C#
- Stars
- 1.8k
- Forks
- 576
- Avg merge
- 6d 9h
- Merged PRs (30d)
- 2
Description
Hi,
I am trying to integrate with an external web service with generated proxy (Connected Services), using message security.
I know message security is not supported currently and you are blocked.
Therefore I have a solution with custom `MessageHeader`, `IEndpointBehavior`, and `IClientMessageInspector`.
As a result, I can successfully authorize.
I can say it because looking at the response from the external web service in Fiddler I see the correct (expected) XML response.
But the problem is that generated proxy client throws an exception:
`System.ServiceModel.Security.MessageSecurityException : Cannot find a token authenticator for the 'System.IdentityModel.Tokens.X509SecurityToken' token type. Tokens of that type cannot be accepted according to current security settings.`
Looks like regardless of the message security is not supported there is some check (validation) of the token sent in response.
Could you please help to find a solution?
Maybe I need just one of the following:
1) disable this token check (if it is not critical for security)
2) create some custom check (maybe smth dummy) and put it in the correct place
3) set up generated clients with existing properties in .NET Core (.NET 6)
But currently, I have no clue how to do any of this.
Contributor guide
Assessment
This issue has not been assessed yet.