Auth0 400 Bad Request Callback error on Login

Hello, The users of my app are facing an error while logging in with a simple email and password login. They got an HTTP 400 Bad Request error, after entering their credentials and clicking on login. We are using NextJS-Auth0 sdk with the required settings from its quick start.

I have checked the logs on monitoring and got a success message from all:

I have setup an action of creating a user on Playfab when user registers on this app:

This is affecting a major crunch of users and does not allow them to login which results in bad user experience and affecting my sales.

1 Like

This is my package.json file:

Hi! Got the exact error info from this:

CallbackHandlerError: Callback handler failed. CAUSE: invalid_grant (Failed to verify code verifier)
at eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/handlers/callback.js:62:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/handlers/auth.js:60:24)
at async C:\Baalak Project\ott-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:63251 {
code: ‘ERR_CALLBACK_HANDLER_FAILURE’,
cause: IdentityProviderError: invalid_grant (Failed to verify code verifier)
at NodeClient.callback (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/auth0-session/client/node-client.js:143:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/auth0-session/handlers/callback.js:43:29)
at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/handlers/callback.js:59:13)
at async eval (webpack-internal:///(rsc)/./node_modules/@auth0/nextjs-auth0/dist/handlers/auth.js:60:24)
at async C:\Baalak Project\ott-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:63251 {
error: ‘invalid_grant’,
errorDescription: ‘Failed to verify code verifier’,
status: 400,
statusCode: 400,
openIdState: { returnTo: ‘http://localhost:3000/’ }
},
status: 400
}

Can anyone explain, how to fix this issue?

Did either of you figure this out?

No! Still didn’t figure out this error

I have the same issue with next-auth0, but only for users with Safari (Webkit). Does this affect all browsers for you?

Has anyone successfully got nextjs-auth0 to work as it should? Honestly.

1 Like

Wait, is this a known limitation? Have I spent weeks trying to make this happen when it’s never going to happen?

I’m having the same issue. I’ve scoured this community, read bug report after bug report, a couple of PRs, and still do not have an answer. What can I do to make logging in work?

This solved my problem:

Chrome actively hides www’s in domain names, and my redirect url never has a www.

1 Like