Getting a Request failed with status code 400 during callback

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.

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

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.

1 Like

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

1 Like