In version 2.9.0 of SAML for ASP .NET Core that I’m currently using and trying to upgrade from, I was able to override OtherFormVariables dictionary and provide my own form variables during HTTP post. In v4.3.0, OtherFormVariables is no longer public and I can’t override. The only way to specify my own variables is during HttpPostForm configuration, but that doesn’t help in my business scenario, since I need to set the variable later in the process. The only way I was able to do it is to use reflection and get private httpPostFormOptions variable and set httpPostFormOptions.OtherFormVariables when I override public override HttpPostFormContent Create(string url, string messageFormVariableName, string messageFormVariableValue,
string relayStateFormVariableName, string relayStateFormVariableValue) method.
This is really something I would like to avoid, but I can’t find any other solutions.