# Getting a Request failed with status code 400 during callback

**URL:** <https://community.auth0.com/t/getting-a-request-failed-with-status-code-400-during-callback/100324>\
**Category:** Get Help\
**Tags:** hooks-management-api, management-api\
**Created:** [February 13, 2023, 2:37am UTC](https://community.auth0.com/t/getting-a-request-failed-with-status-code-400-during-callback/100324 "2023-02-13T02:37:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarebb](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jarebb/32/44259_2.png) [@jarebb](https://community.auth0.com/u/jarebb)\
**Post date:** [February 13, 2023, 2:37am UTC](https://community.auth0.com/t/getting-a-request-failed-with-status-code-400-during-callback/100324/1 "2023-02-13T02:37:11Z")

</div>

Hello everyone, I’m trying to set up Auth0 using @auth0/nextjs-auth0 with NextJS. Everything was working fine until two days ago when it suddenly returned an error during the callback. Users were still able to successfully authenticate using the passwordless magic link, but the error only occurred when Auth0 redirected the user back to our callback. Here is the URL returned from Auth0:

`http://localhost:3000/api/auth/callback/?error=access_denied&error_description=Request%20failed%20with%20status%20code%20400&state=eyJyZXR1cm5UbyI6Imh0dHA6Ly9sb2NhbGhvc3Q6MzAwMC8ifQ`

The error description stated that a request failed with a status code of 400 and the error as access\_denied. I’m unsure how to debug this issue, which appears to be a configuration problem in the Auth0 console.

Has anyone faced the same issue?

This is the auth API code I used.

```auto
export default handleAuth({
  async login (req, res) {
    return await handleLogin(req, res, {
      authorizationParams: {
        audience: 'https://stg-api',
        scope: 'openid profile email read:listings'
      }
    })
  }
})

```

---

<div class="post-metadata">

**Author:** ![jarebb](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jarebb/32/44259_2.png) [@jarebb](https://community.auth0.com/u/jarebb)\
**Post date:** [February 13, 2023, 8:16am UTC](https://community.auth0.com/t/getting-a-request-failed-with-status-code-400-during-callback/100324/3 "2023-02-13T08:16:19Z")

</div>

We found the issue, it is due to an Action flow we setup to call one of our API, however the API is returning 400.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 13, 2023, 8:52am UTC](https://community.auth0.com/t/getting-a-request-failed-with-status-code-400-during-callback/100324/4 "2023-02-13T08:52:28Z")

</div>

Ohhh got it! Thanks for sharing the reason with others!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 22, 2023, 12:26pm UTC](https://community.auth0.com/t/getting-a-request-failed-with-status-code-400-during-callback/100324/5 "2023-02-22T12:26:57Z")

</div>


