Migrating from .net Framework to .net core - Need use equivalent of Low Level API for HTTPRedirectBinding.CreateRequestRedirectURL


We are in the process of migrating our code base to .NET Core , we make use of low level api’s from ComponentSpace.SAML2.Bindings from the old ComponentSpace.SAML2 .Net Framework dll in our implementation. We use the following method:

HTTPRedirectBinding.CreateRequestRedirectURL(string baseURL, XmlElement samlMessage, string relayState, AsymmetricAlgorithm key, string signatureAlgorithm);

We do not want to change our current implementation - is there any equivalent method in the new ComponentSpace.SAML2 .NET Core dll ?


Hi Ash,

The equivalent is the IHttpRedirectBinding interface under the ComponentSpace.Saml2.Bindings.Redirect namespace. You can access this interface through dependency injection.

There isn’t a directly equivalent method. The closest is SendMessageAsync.

However, I strongly recommend you take the opportunity to switch to the SAML high-level API. The ISamlServiceProvider.InitiateSsoAsync creates and sends a SAML authn request using the HTTP-Redirect binding. This is demonstrated by the ExampleServiceProvider project and documented in the Examples Guide and Developer Guide.

You’ll end up writing a lot less code and it will be a lot easier to maintain.