# Okta as IdP Auth0 as SP redirect uri ignored

**URL:** <https://community.auth0.com/t/okta-as-idp-auth0-as-sp-redirect-uri-ignored/158426>\
**Category:** Get Help\
**Tags:** connections, saml-enterprise-connection\
**Created:** [December 7, 2024, 5:16pm UTC](https://community.auth0.com/t/okta-as-idp-auth0-as-sp-redirect-uri-ignored/158426 "2024-12-07T17:16:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![barry](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/barry/32/62701_2.png) [@barry](https://community.auth0.com/u/barry)\
**Post date:** [December 7, 2024, 5:16pm UTC](https://community.auth0.com/t/okta-as-idp-auth0-as-sp-redirect-uri-ignored/158426/1 "2024-12-07T17:16:15Z")

</div>

I have set up my SAML configuration for localhost on my DEV tenant using the guide here:  
[Configure Okta as SAML Identity Provider](https://auth0.com/docs/authenticate/protocols/saml/saml-sso-integrations/configure-auth0-saml-service-provider/configure-okta-as-saml-identity-provider)

When I test the connection from the Auth0 “Try” button it works successfully. However, I want to test the SAML flow when it’s initiated in the Okta dashboard. In order to do this, under Idp Initiated Requests I select “Accept Requests” and select my client application as the default application. Then I added a redirect\_uri in the “Query String” input field. This redirect uri is to my server side code seeing as the final redirect is a Post request with a SAMLResponse body.

However, this redirect\_url is ignored and a post request goes to the first callback URL in the Allowed Callback URLs for the app.

What am I missing to get this final step to work? Also, do I need to decode the SamlResponse? I would have thought that Auth0 would do this and create a JWT token for the user just as it does for other login types. Please let me know what I’m missing.

Thanks.

---

<div class="post-metadata">

**Author:** ![barry](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/barry/32/62701_2.png) [@barry](https://community.auth0.com/u/barry)\
**Post date:** [December 9, 2024, 7:17pm UTC](https://community.auth0.com/t/okta-as-idp-auth0-as-sp-redirect-uri-ignored/158426/3 "2024-12-09T19:17:46Z")

</div>

For anyone else who gets stuck in the same place as I did, the solution was to select Open ID Connect as the response protocol for the IdP initiated login.

However, my application is a ReactJS SPA. Auth0Provider is the HOC that handles token exchange for other logins, but it seems like it doesn’t handle it for IdP initiated logins. No idea why this is. Anyway, I found a solution here:

> <https://github.com/auth0/auth0-spa-js/issues/213>
>
> As per the official documentation \[here\](https://auth0.com/docs/protocols/saml/i…dp-initiated-sso), is there any support for the IDP initiated SSO?
> 
> Or is this already supported within the constructor?
> 
> \> If you are using Auth0.js, you have to update the webAuth.parseHash of the library and set the flag \_\_enableIdPInitiatedLogin to true.
> \> \`\`\`javascript
> \> var data = webAuth.parseHash(
> \> {
> \> ...
> \> \_\_enableIdPInitiatedLogin: true
> \> ...
> \> }
> \> \`\`\`
> \> If you're using Lock, you can include the flag using the options parameter sent to the constructor.
> \> \`\`\`javascript
> \> const options = {
> \> \_enableIdPInitiatedLogin: true
> \> };
> \> const lock = new Auth0Lock(clientID, domain, options)
> \> \`\`\`
> \> Note that the enableIdPInitiatedLogin flag is preceded by one underscore when used with Lock and two underscores when used with the auth0.js library.

In order to use this solution, I needed to add the connection\_id to my redirect\_uri in the IdP initiated connection settings. All works now.

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [December 9, 2024, 7:21pm UTC](https://community.auth0.com/t/okta-as-idp-auth0-as-sp-redirect-uri-ignored/158426/4 "2024-12-09T19:21:44Z")

</div>

Hi @barry,

Thank you for sharing this with the Community, happy to know that this has now been resolved!

Have a great one,  
Gerald

---

<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:** [December 23, 2024, 7:22pm UTC](https://community.auth0.com/t/okta-as-idp-auth0-as-sp-redirect-uri-ignored/158426/5 "2024-12-23T19:22:11Z")

</div>

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