# Okta enterprise connection: 400 bad request redirect\_uri set incorrectly

**URL:** <https://community.auth0.com/t/okta-enterprise-connection-400-bad-request-redirect-uri-set-incorrectly/120204>\
**Category:** Get Help\
**Tags:** oidc-enterprise-connection, connections\
**Created:** [November 3, 2023, 10:10pm UTC](https://community.auth0.com/t/okta-enterprise-connection-400-bad-request-redirect-uri-set-incorrectly/120204 "2023-11-03T22:10:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhsong](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dhsong/32/48763_2.png) [@dhsong](https://community.auth0.com/u/dhsong)\
**Post date:** [November 3, 2023, 10:10pm UTC](https://community.auth0.com/t/okta-enterprise-connection-400-bad-request-redirect-uri-set-incorrectly/120204/1 "2023-11-03T22:10:12Z")

</div>

I’m trying to set up enterprise connection with Okta through our Auth0 tenant. I’ve set up Okta as per directions here: [Connect Your Auth0 Application with Okta Workforce Enterprise Connection](https://auth0.com/docs/authenticate/identity-providers/enterprise-identity-providers/okta) and am able to receive a “It Works!” message and a new user created with the okta connection when I click “Try” through the auth0 enterprise connections dashboard.

I’ve set it up so that users have the option to sign in with Okta using a button in the login flow. However, when I click the button while testing our webapp on localhost, I get the Okta 400 Bad Request error message with the details:

- Your request resulted in an error. The ‘redirect\_uri’ parameter must be a Login redirect URI in the client app settings:

The error message is straightforward, redirect\_uri must be set incorrectly. However, I’ve tried every possible redirect\_uri I can think of. The one Auth0 recommends to use is:

https://.us.auth0.com/login/callback/

I’ve tried adding a wildcard at the end as well. I’ve also tried using the redirect\_uri shown in the url below, which is the url of the Okta 400 bad request error message page. I’ve also tried using simply [http://localhost:8000/](http://localhost:8000/) which is the port we’re using for localhost.

https:///oauth2/v1/authorize?client\_id=\<client\_id\>&scope=openid%20profile%20email&response\_type=code&redirect\_uri=https%3A%2F%2Fauth..app%2Flogin%2Fcallback&response\_mode=query&state=o\_peg1nSQdNFyl8cC41LPd9akvLf-YFX

I’m beginning to think this is an Auth0 issue not an Okta issue but any suggestions here? Are there any extra configurations I have to do at the routing level to ensure the correct redirect\_uri is being hit?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [November 9, 2023, 3:14pm UTC](https://community.auth0.com/t/okta-enterprise-connection-400-bad-request-redirect-uri-set-incorrectly/120204/3 "2023-11-09T15:14:15Z")

</div>

Hi @dhsong,

I understand you are having issues setting up an Okta connection. I have set up an Okta connection and can confirm it is working properly.

Are you using a custom domain?

---

<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:** [November 28, 2023, 3:19pm UTC](https://community.auth0.com/t/okta-enterprise-connection-400-bad-request-redirect-uri-set-incorrectly/120204/4 "2023-11-28T15:19:58Z")

</div>

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