# How to pass the relay state in the Application?

**URL:** <https://devforum.okta.com/t/how-to-pass-the-relay-state-in-the-application/21803>\
**Category:** SAML\
**Created:** [September 8, 2022, 11:25am UTC](https://devforum.okta.com/t/how-to-pass-the-relay-state-in-the-application/21803 "2022-09-08T11:25:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhankarabhilash](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dhankarabhilash](https://devforum.okta.com/u/dhankarabhilash)\
**Post date:** [September 8, 2022, 11:25am UTC](https://devforum.okta.com/t/how-to-pass-the-relay-state-in-the-application/21803/1 "2022-09-08T11:25:41Z")

</div>

I am trying to implement SP-initiated SSO by creating an application and an IDP application. We are passing a resource URI as default relay-state in the SP application. But after the IDP validation, it is not redirected to the relay-state URI. It stays on the IDP url page.  
Need help in configuring the relay-state for the SP app.

---

<div class="post-metadata">

**Author:** ![wecode](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@wecode](https://devforum.okta.com/u/wecode)\
**Post date:** [September 8, 2022, 1:17pm UTC](https://devforum.okta.com/t/how-to-pass-the-relay-state-in-the-application/21803/2 "2022-09-08T13:17:28Z")

</div>

I have the same issue. Here is a link in case it gets answered:

> [@SAML RelayState deep link not working](https://devforum.okta.com/t/saml-relaystate-deep-link-not-working/21780):
>
> We are working through the API docs implementing a custom SAML solution using SP initiated auth flow We got our external SP successfully checking with OKTA, and getting a SAML assertion + session cookie on users browser. The problem we are having is the RelayState parameter points to a deeper link in the SP, and we are always directed to the SP home page instead after OKTA validates the user session for SP This is an example of the URL we are invoking with some text replaced with generic plac…

---

<div class="post-metadata">

**Author:** ![rachid](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rachid](https://devforum.okta.com/u/rachid)\
**Post date:** [September 8, 2022, 2:25pm UTC](https://devforum.okta.com/t/how-to-pass-the-relay-state-in-the-application/21803/3 "2022-09-08T14:25:29Z")

</div>

Also the same issue. Okta does not redirect to the application URL  
Regards.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 10:00pm UTC](https://devforum.okta.com/t/how-to-pass-the-relay-state-in-the-application/21803/4 "2024-02-12T22:00:14Z")

</div>


