# Help: server\_error: Unable to issue redirect for OAuth 2.0 transaction

**URL:** <https://community.auth0.com/t/help-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/100120>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [February 9, 2023, 7:29pm UTC](https://community.auth0.com/t/help-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/100120 "2023-02-09T19:29:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![drew.daniels](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/drew.daniels/32/44500_2.png) [@drew.daniels](https://community.auth0.com/u/drew.daniels)\
**Post date:** [February 9, 2023, 7:29pm UTC](https://community.auth0.com/t/help-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/100120/1 "2023-02-09T19:29:02Z")

</div>

I have 2 apps we are trying to get set up to use Auth0 and _believe_ I have set up everything correctly in both. However, only one works, even though the configurations for both appear to be the exact same. Here is the error page I am redirected to in the second app (which does not work):

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

In the first, we are successfully able to redirect users to the Universal Login page, have them authenticate, and then be redirected to the `redirect_uri` we specify in our `Auth0Provider` options. However, in the second, we are redirected to the above error page.

Here are the configurations we are using in both apps:

```auto
REACT_APP_AUTH0_ISSUER_URL=<issuer-url>
REACT_APP_AUTH0_CLIENT_ID=<client-id>
REACT_APP_AUTH0_AUDIENCE=<api-url>
REACT_APP_AUTH0_REDIRECT_URI="http://localhost:3003/user/callback"
REACT_APP_AUTH0_SCOPES=<scopes>

```

We are then using these environment variables and assigning them to our `Auth0Provider` like this:

```auto
const auth0config = {
  domain: REACT_APP_AUTH0_ISSUER_URL,
  clientId: REACT_APP_AUTH0_CLIENT_ID,
  audience: REACT_APP_AUTH0_AUDIENCE,
  redirectUri: REACT_APP_AUTH0_REDIRECT_URI,
  scope: REACT_APP_AUTH0_SCOPES,
};

function Auth0Wrapper({ children }) {
  return <Auth0Provider {...auth0config}>{children}</Auth0Provider>;
}

```

In the second failing app, I have verified the the `redirect_uri` is valid _and_ is set as an Allowed Callback URL _and_ it exactly matches what we’re using in the above configuration, however I’m still getting sent to that error page.

Any help on this would be greatly appreciated, and if there is any other context I could provide that would be helpful I would be happy to elaborate.

I am running this on:

- MacOS Ventura 13.0
- Chrome 110.0.5481.77 (Official Build) (x86\_64)
- Node v12.18.1
- `auth0/auth0-react` `^2.0.0`

EDIT:  
I have taken a look at these issues already to see if I was making the same mistake but they appear to be unrelated:

- [Possible causes for "Unable to issue redirect for OAuth 2.0 transaction"?](https://community.auth0.com/t/possible-causes-for-unable-to-issue-redirect-for-oauth-2-0-transaction/6149)
- [“Unable to issue redirect for OAuth 2.0 transaction” using a database connection (but Social Provider works) - #6 by skllpara](https://community.auth0.com/t/unable-to-issue-redirect-for-oauth-2-0-transaction-using-a-database-connection-but-social-provider-works/47665/6)

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 9, 2023, 9:50pm UTC](https://community.auth0.com/t/help-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/100120/2 "2023-02-09T21:50:34Z")

</div>

Hi there @drew.daniels welcome to the community!

Interesting 🤔 If you inspect the network tab during the login flow for both apps, do both of the calls to `/authorize` look the same? I’d be happy to take a look if you want to share them here - Feel free to redact any non-related params.

Keep us posted!

---

<div class="post-metadata">

**Author:** ![drew.daniels](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/drew.daniels/32/44500_2.png) [@drew.daniels](https://community.auth0.com/u/drew.daniels)\
**Post date:** [February 10, 2023, 4:44pm UTC](https://community.auth0.com/t/help-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/100120/4 "2023-02-10T16:44:37Z")

</div>

Hi @ty.frith thanks for taking a look into this!

I’m glad you mentioned that - it looks like in the first app:

- The `domain` is set to the `domain` of our `primary-auth0-application`
- The `redirect_uri` param is set to `http://localhost:3003/user/callback`

However in the second app:

- The `domain` is set to a separate Auth0 app we are using as an IDP.
- The `redirect_uri` param is set to the `domain` of our `primary-auth0-application`

First app:

```auto
https://<primary-auth0-app-domain>/authorize?audience=<audience>&scope=<scopes>&client_id=<client-id>&redirect_uri=<url-encoded-redirect-uri>&response_type=code&response_mode=query&state=<state>&nonce=<nonce>&code_challenge=<code-challenge>&code_challenge_method=<challenge-method>

```

Second app:

```auto
https://<secondary-idp-domain>/authorize?client_id=<client-id>&scope=<scopes>&response_type=code&redirect_uri=<primary-auth0-app-domain>&response_mode=query&state=<state>

```

This leads me to think maybe theres some misconfiguration with the Auth0 app we’re using as an IDP, but the Allowed Callback URLs setting there shows that both the `redirect_uri`s of our `primary-auth0-app-domain` and `http://localhost:3003/user/callback` are allowed.

I should maybe mention that in the first app, I have an existing session so I am able to skip the Universal Login screen, and in the second (failing) app, I do not. Maybe this has something to do with why the `/authorize` request in the second app is missing some parameters that are included in the first.

---

<div class="post-metadata">

**Author:** ![drew.daniels](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/drew.daniels/32/44500_2.png) [@drew.daniels](https://community.auth0.com/u/drew.daniels)\
**Post date:** [February 14, 2023, 4:31pm UTC](https://community.auth0.com/t/help-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/100120/5 "2023-02-14T16:31:43Z")

</div>

Figured out what the issue was.

My first working app was using v1 of `auth0/auth0-react` whereas my second was using v2, so this config which worked with v1 did not work in v2:

```auto
const auth0config = {
  domain: REACT_APP_AUTH0_ISSUER_URL,
  clientId: REACT_APP_AUTH0_CLIENT_ID,
  audience: REACT_APP_AUTH0_AUDIENCE,
  redirectUri: REACT_APP_AUTH0_REDIRECT_URI,
  scope: REACT_APP_AUTH0_SCOPES,
};

function Auth0Wrapper({ children }) {
  return <Auth0Provider {...auth0config}>{children}</Auth0Provider>;
}

```

Instead, it should be:

```auto
const auth0config = {
  domain: REACT_APP_AUTH0_ISSUER_URL,
  clientId: REACT_APP_AUTH0_CLIENT_ID,
  authorizationParams: {
    audience: REACT_APP_AUTH0_AUDIENCE,
    redirect_uri: REACT_APP_AUTH0_REDIRECT_URI,
    scope: REACT_APP_AUTH0_SCOPES,
  }
};

function Auth0Wrapper({ children }) {
  return <Auth0Provider {...auth0config}>{children}</Auth0Provider>;
}

```

I had not realized there breaking changes in the latest update (my mistake), but it would have been nice if there were more descriptive errors thrown - although maybe the error I received should have been enough to indicate that something was wrong with my configuration of `redirect_uri`.

[v1 to v2 migration guide](https://github.com/auth0/auth0-react/blob/master/MIGRATION_GUIDE.md)

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 14, 2023, 6:43pm UTC](https://community.auth0.com/t/help-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/100120/6 "2023-02-14T18:43:09Z")

</div>

Hey @drew.daniels!

Sorry for the delayed response, but good to know you were able to get this sorted and thanks for following up with the community! I’m sure this will help others moving forward 🙏

---

<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:** [February 28, 2023, 6:43pm UTC](https://community.auth0.com/t/help-server-error-unable-to-issue-redirect-for-oauth-2-0-transaction/100120/7 "2023-02-28T18:43:23Z")

</div>

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