Dynamic AssertionConsumerServiceUrl : how to set...

Looking at the documention under InitilateSSO, it says the fourth parameter is the target service provider URL or null if the default page should be displayed. I am setting the value to a URL, which is not being used.
The default value is used.
If I leave the default value blank, I get an error message.
How can I dynamically set the service URL?

Just to confirm, you are the identity provider and are calling SAMLidentityProvider.InitiateSSO?
Assuming so, the target URL is the URL the service provider should redirect to after SSO completes. It’s up to the serviceprovider to do this.
Please enable SAML trace and send us the generated log file as an email attachment. I want to confirm that a URL is being passed to the service provider correctly.