-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another question about WCF Core and MutualCertificateBinding #4854
Comments
Here's a comment I wrote answering a similar question. Let me know if you have more questions beyond that. |
Thank you for the swift reply. That StrTransform is definitely a troublesome one.
When studying how the StrTransform was done in .NET Framework, I thought the StrTransform class was where I needed to look at. It was not until I could debug into .NET Framework code that I figured out where the cheat was. 😢 That said, I actually managed to make a StrTransform (cheat) implementation that works for me 😁. My use cases only need to use a SecurityTokenReference that always points to an SAML assertion, so it was easier (and has smaller attack surface) than a full support for sure. I have two problems left (at least for now): The first one is that when my client code handles a response, it throws:
The reason is obvious: because the Mutual binding is not supported, The second issue is that if my client code gets the error below, but if I open Fiddler and configure a client certificate for it, the error disappears. This is probably me configuring my custom binding wrong so I will do my own research for this one :)
|
Hi @thuannguy , Could you please explain how to overcome the exception: You mentioned manual validation. |
My workaround is to implement a custom IRequestChannel that wraps around the original channel. In WCF, the response's signature is validated after the EndRequest method exits. Therefore, I add my own signature validation to the EndRequest method. This involves converting the Message object to an XmlDocument and validating its signature. After validation, I remove the signature and convert the no-signature message back to a new Message object. Finally, I store the original message in the Properties list so that other code can use it when needed. Security-wise, this solution works for me because my use cases are well-controlled. I know exactly the message format, what certificate that I need to use for signature validation, and what algorithms to use. public class MyCustomSoapChannel : ChannelBase, IRequestChannel
{
public Message EndRequest(IAsyncResult result)
{
Message originalResponse = _innerChannel.EndRequest(result);
originalResponse = ValidateSignature(originalResponse);
var manipulatedResponse = ModifyMessageToSkipDefautValidation(originalResponse);
manipulatedResponse.Properties.Add("originalMessage", originalResponse);
return manipulatedResponse;
}
} |
@thuannguy, thank you very much. |
Per #4659, the MutualCertificate binding is not supported yet.
This is how source code looks like today:
@mconnew replied that " unfortunately due to missing dependencies we can't yet support full Message security which is needed for your configuration".
I open this issue as an attempt to learn more about that "missing dependencies". Could you please clarify what the missing dependencies are? What if I need to port or implement the MutualCertificateBinding (as a custom binding) myself (perhaps just enough for my use cases?). Is that doable or do I really need to wait for those "missing dependencies"? Could you please point me to the right directly?
The text was updated successfully, but these errors were encountered: