I have this code to create a “RequestSecurityToken
“:
var request = new RequestSecurityToken
{
TokenType = "some:urn",
AppliesTo = new EndpointReference($"some:other:urn"),
Issuer = new EndpointReference("https://some.domain.net"),
RequestType = RequestTypes.Issue
};
and I found that the generated xml has the “Issuer” tag made like this:
<trust:Issuer>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>https://some.domain.net/</wsa:Address>
</wsa:EndpointReference>
</trust:Issuer>
The problem is that the SecurityTokenService expects the “Issuer” tag to contain only the “wsa:Address” tag (without the “EndpointReference” wrap):
<trust:Issuer>
<wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">
https://some.domain.net/
</wsa:Address>
</trust:Issuer>
I already have an implementation of “IClientMessageInspector
” to add some headers to the request message before sending it, but I didn’t want to also change the request body in it.
I also tried to override the Issuer property in a custom class, but then it doesn’t serialize the message correctly.
Is there another way to resolve this (beside changing the xml before sending it)?
Application uses .NET Framework 4.8
Francesco Franzini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.