# SSO SAML failing with Auth0 as Identity Provider - Missing RelayState in SAML response

**URL:** <https://community.auth0.com/t/sso-saml-failing-with-auth0-as-identity-provider-missing-relaystate-in-saml-response/123777>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [December 27, 2023, 11:09pm UTC](https://community.auth0.com/t/sso-saml-failing-with-auth0-as-identity-provider-missing-relaystate-in-saml-response/123777 "2023-12-27T23:09:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajbily](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@ajbily](https://community.auth0.com/u/ajbily)\
**Post date:** [December 27, 2023, 11:09pm UTC](https://community.auth0.com/t/sso-saml-failing-with-auth0-as-identity-provider-missing-relaystate-in-saml-response/123777/1 "2023-12-27T23:09:36Z")

</div>

Hello,

We are trying to use Auth0 as a SAML identity provider for using the RingCentral application as the SAML service provider. The SAML handshake is occurring, but RingCentral is rejecting the  
SAML response from Auth0 SAML identity provider.

I created a ticket with Ring Central. They report that my configuration of Auth0 identity provider is not setting the RelayState parameter as needed. Can you tell me how to have Auth0 SAML identity provider to return the RelayState parameter required?

Kind regards,

Andy Bily

note: sent to RingCentral:  
Single Signon integration between RingCentral -and- Auth0 via SAML - Ring Central Error  
Hello, We’re trying to setup single signon integration between Ring Central and our Auth0 (division of Okta) single signon identity provider. We use Auth0 for other applications using SAML integration, and it works fine for us. With Ring Central integration, we’re getting an error: Error Unexpected Error Sorry for the inconvenience. Please contact your administrator to provide the reference number below in order to find the corresponding error. Reference number: fb9e4995-a12a-491a-a714-c698408cfaac

note from RingCentral:  
Hello Andy,  
Good day!  
Apologies for the late response.  
I have discussed this concern with our Engineers and they told me that you need to open a support case with Auth0. Because the RelayState parameter should be sent to the RIngCentral along with the SAML response, but now the Relay State is blank and authentication fails.  
Regards,  
Ed  
RingCentral Integrations Support

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [January 4, 2024, 11:36am UTC](https://community.auth0.com/t/sso-saml-failing-with-auth0-as-identity-provider-missing-relaystate-in-saml-response/123777/2 "2024-01-04T11:36:06Z")

</div>

Hi @ajbily , I will try to help with that.

The RealyState parameter is the final destination URL on the Service Provider side, once the user has authenticated against Auth0.

Does the issue happen during the SP initiated login? (Meaning the user first try to reach RingCentral app and as a result is redirected to Auth0 Login Page?)

> [@ajbily](#):
>
> Can you tell me how to have Auth0 SAML identity provider to return the RelayState parameter required?

Could you navigate to:  
`Auth0 tenant->Applications -> RingCentral->Endpoints->SAML section-> SAML Sign In`

and update the existing URL to contain the `RealyState` parameter (most likely this parameter takes the same value you have set for the Callback URL for this app) in this format:

`https://[auth0domain].us.auth0.com/samlp/FdPxxxxxxxxxxxxxbVk?RelayState=[URL of the final destination on the Service Provider site (RingCentral)]`

On the browser side, after URL-encoding the RelayState parameter, it will look like ths:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/6/9/69632c11a9afbf155c1927efd5c97f6eb6ee3092.png)

Please let us know if it works for you!

---

<div class="post-metadata">

**Author:** ![ajbily](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@ajbily](https://community.auth0.com/u/ajbily)\
**Post date:** [January 8, 2024, 5:51pm UTC](https://community.auth0.com/t/sso-saml-failing-with-auth0-as-identity-provider-missing-relaystate-in-saml-response/123777/3 "2024-01-08T17:51:32Z")

</div>

Hi Marclina,

Thanks for the reply.

The URL doesn’t seem to be editable in the UI (I can copy the URL, but can’t seem to edit it). Thoughts?

 ![image](https://global.discourse-cdn.com/auth0/original/3X/0/3/03d10ed958cbf34710ba8a6013828ee139ac7b97.png)

Regards,

Andy

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [January 9, 2024, 2:44pm UTC](https://community.auth0.com/t/sso-saml-failing-with-auth0-as-identity-provider-missing-relaystate-in-saml-response/123777/4 "2024-01-09T14:44:59Z")

</div>

Hi Andy,

> [@ajbily](#):
>
> (I can copy the URL, but can’t seem to edit it).

I will investigate this further.

Can you please let me know if the issue persists when you copy and paste this URL along with relayState directly to the browser search bar? (this way you will initiate authentication flow)

---

<div class="post-metadata">

**Author:** ![ajbily](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@ajbily](https://community.auth0.com/u/ajbily)\
**Post date:** [January 9, 2024, 3:09pm UTC](https://community.auth0.com/t/sso-saml-failing-with-auth0-as-identity-provider-missing-relaystate-in-saml-response/123777/5 "2024-01-09T15:09:12Z")

</div>

Hi Marcelina,

Here’s what I get when i paste the URL, including the RelayState into the browser:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/d/b/dbc80653bf3cc85497c8dc5e606bab02172b2325.png)

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [January 10, 2024, 9:28am UTC](https://community.auth0.com/t/sso-saml-failing-with-auth0-as-identity-provider-missing-relaystate-in-saml-response/123777/6 "2024-01-10T09:28:53Z")

</div>

Thank you!

And if you URL-encode the RealyState?

Looking at auth0 tenants associated with your community email address, I was able to initiate the login flow for the tenant: _[platfxxxxx-gxxxxc-com.us.auth0.com](http://platfxxxxx-gxxxxc-com.us.auth0.com)_ and the following URL:

[https://platfxxxxx-gxxxxc-com.us.auth0.com/samlp/FdPBl4bWxxxxxxxxxxxxKbVk?RealyState=https%3A%2F%2Fsso.ringcentral.com%2Fsp%2FACS.saml2](https://platfxxxxx-gxxxxc-com.us.auth0.com/samlp/FdPBl4bWxxxxxxxxxxxxKbVk?RealyState=https%3A%2F%2Fsso.ringcentral.com%2Fsp%2FACS.saml2)

For the RelayState I used this callback url (URL-encoded):

 ![image](https://global.discourse-cdn.com/auth0/original/3X/4/f/4f4c57f6347c9afb9805f3be8d56ab728809d866.png)

Could you try to test the login with this one?

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [January 11, 2024, 12:51pm UTC](https://community.auth0.com/t/sso-saml-failing-with-auth0-as-identity-provider-missing-relaystate-in-saml-response/123777/8 "2024-01-11T12:51:56Z")

</div>

Hi @ajbily !

Were you able to move forward with your SAML integration?

I went ahead and also consulted our SAML engineering team - and the RelayState has to be provided by SP along with the request to the **Identity Provider Login URL**. The exact string (URL decoded) will be returned as RelayState with the SAML response.

Suppose the application has the **Identity Provider Login URL** : `https://test.local.dev.auth0.com/samlp/3h9qAQsqC4H9Uhhj4MnYiq3kkaG2qPYe`  
If the request made to Auth0 is  
`https://test.local.dev.auth0.com/samlp/3h9qAQsqC4H9Uhhj4MnYiq3kkaG2qPYe?RelayState=https%3A%2F%2Fsso.ringcentral.com%2Fsp%2FACS.saml2`

The returned response will be

```auto
*SAMLResponse: <encoded string>
*RelayState: https://sso.ringcentral.com/sp/ACS.saml2*

```

My advice would be to try with the _`https://sso.ringcentral.com/sp/ACS.saml2`_ as the RelayState and have this URL set as the Allowed Callback URLs in your Auth0 tenant → Applications → ringcentral → Settings → Allowed Callback URLs.

Hope this helps! Your feedback would be appreciated!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 25, 2024, 12:52pm UTC](https://community.auth0.com/t/sso-saml-failing-with-auth0-as-identity-provider-missing-relaystate-in-saml-response/123777/9 "2024-01-25T12:52:40Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
