I am able to generate SecurityToken but I am unable to pass it when creating channel.
In .NET Framework 4.8 I could do,
var proxy = factory.CreateChannelWithIssuedToken(securityToken);
But I am unable to find alternative in .Net Core, I looked at decompiled source,
I tried this by creating a poco "FederatedClientCredentialsParameters" but this didn't work either.
var proxy = factory.CreateChannel();
IClientChannel clientChannel = (IClientChannel) proxy;
clientChannel.GetProperty<ChannelParameterCollection>().Add(new FederatedClientCredentialsParameters()
{
IssuedSecurityToken = token
});
I have tried looking into setting factory.endpointbehavior but can't find an avenue where I can insert security token. Most answers seems to be around client credential for username and password but not related WS Trust based security token.