(My apologies, this is a re-post, I just found salesforce.stackexchange)

I am the Service Provider. Also, a shout-out to this open source C# component (AspNetSaml), they made life a bit easier: https://github.com/jitbit/AspNetSaml

Anyhow, when I send a request to the IdP (in this case SalesForce), I am providing an ACS URL and I can see that it is set here in my xml:

xw.WriteAttributeString("ProtocolBinding", "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST");
xw.WriteAttributeString("AssertionConsumerServiceURL", _assertionConsumerServiceUrl);

(_assertionConsumerServiceUrl is what I really want it to redirect to, and I can see that it's set)

But what happens with Salesforce is that it always uses the ACS URL I was required to set when creating the Connected App:

enter image description here

I have my real ACS URL value blanked out, but that value is what it is always re-directed to.

There has to be a way. Imagine if instead of redirecting to http://www.foo.com/, you wanted to instead redirect to: http://www.foo.com/?SomeValue=???? ... where ???? can be all different values. I mean, if the user typed in http://www.foo.com/?SomeValue=1234, and it redirected to Salesforce just to sign-in, I'd like to be able to continue with SomeValue=1234, as that's what the original user intended to do (as opposed to going to static www.foo.com every time).

This has to be possible! Thanks!

  • A RelayState parameter, that you add when redirecting to the IdP, looks promising! Mar 6 '18 at 3:17
  • Yes, you need a RelayState.
    – sfdcfox
    Mar 6 '18 at 5:10
  • Ok good. Confirmation. I say that if that's the only option/solution I have, answer the question (instead of comments) so that I can give you a green check mark (and rep points)! ... Basically, I need to transfer var1=value1&var2=value2, so it looks like I might have to finagle it in some way because of the equal signs and ampersand's. I'd imagine you can't do RelayState=var1=value1&var2=value2. Mar 6 '18 at 15:18

The RelayState is meant to direct the user after a successful login to a specific location in the application they're logging in to. If you need to include query parameters, make sure they're URL encoded:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.