Hi, In our flow we need to be able to send differe...
# ask-a-descoper
m
Hi, In our flow we need to be able to send different returnUrl to IdP initiates SSO login. I updated the flow, but when I log in via IdP initiated I get the old params. Am I doing something wrong? Is there maybe a stale cache somewhere?
k
Experiencing this issue as well but haven't got an answer yet
d
In case of IdP initiated the only way to provide the redirect url is via the post auth redirect url. But at the past we provided you a solution to pass any param in the relayState that your app can read and act upon.
m
If it is IdP initiated I can't set a relayState, no? And what do you mean by
via the post auth redirect url
?
d
Here you can define the Post Authentication URL, this URL can by dynamic as well, according to the tenant domain/configuration.
Just to make sure are you referring to federated SAML app or for a regular tenant login? Just to understand the use case.
m
I am referring to regular login
But I need to be able to differentiate between IdP initiated and not
s
We thought of splitting up the IdP initiated SSO from the SP Initiated SSO like so, and using the Redirect URL param there, but it didn't worked
d
ok, so you want to pass any indication that it comes from IdP Initiated?
s
Our problem is that for SP initiated login, there might be some query params (like the path to navigate after login) we need. The default behavior is to return to the origin URL which keeps the query params. If we set the returnURL, we set it without query params, but it makes SP initiated SSO login to loose the query params Hence we wanted to set it only to IdP Initiated The alternative is to set it programmatically for every SP initiated login
t
Hi, let's have a session to better understand your use case. What is your availability tomorrow?
m
Can we do 11?
t
11 no, but can do at 10 or between 14:00 and 16:00
m
Let's do 14:00
t
Sending an invite
Hi, the best solution to this is to pass the redirectUrl as a start option to the flow, like this:
Copy code
<Descope
  flowId={flowId}
  redirectUrl={redirectUrl}
  onSuccess={(e) => {
    console.log("Logged in!");
  }}
  onError={(e) => console.log("Error!")}
/>
It gets priority over the post authentication redirect URL, so when you do SP initiated it will use this value (and when you use IdP initiated it will use the post authentication redirect URL).