Replies: 67 comments 80 replies
-
Same problem with Auth0 and VK providers. Looks like problem might be because of an Next.js update - that error doesn't happen for me on Next 13.3.0 |
Beta Was this translation helpful? Give feedback.
-
I have the same problem with Google and Github Providers. Opened a discussion about it ( #7403 ) but still nothing. I found something similar and tried to use the solution that was found there ( #6898 ) but it wasn't working. Even downgraded to 13.2.4: nothing. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue with Google provider with Firebase. I am using Tried to define cookies with |
Beta Was this translation helpful? Give feedback.
-
Had this exact same error recently in production. We have a brokered login in out auth solution, and found many of these errors in the logs:
I could reproduce the problem in windows + latest Edge by the following steps:
|
Beta Was this translation helpful? Give feedback.
-
Had this problem with Auth0. what tripped me up is I specify the callback in the signIn method, but that doesn't redirect properly. |
Beta Was this translation helpful? Give feedback.
-
Had this exact same error recently in production. I'm not able to reproduce the problem, but I am experiencing a concerning error rate in production. Therefore I'm not actually sure this error is causing real problems.
|
Beta Was this translation helpful? Give feedback.
-
Same error here with the Discord provider. All works fine on localhost but see the problem when deployed to vercel. Tried the redirect callback but no change. |
Beta Was this translation helpful? Give feedback.
-
I've spent hours solving this issue with Next-Auth 4.22.1. Didn't work on either localhost or pm2. Eventually upgraded from Next 13.2.4 to 13.4.4 and that solved it on both local and remote servers. |
Beta Was this translation helpful? Give feedback.
-
An app with Next 13.4.2 and Next-Auth 4.22.1, deployed on Google App Engine, had this issue when using the Google provider. In "Authorized redirect URIs" I had "https://www.example.com/api/auth/callback/google", but after adding "https://example.com/api/auth/callback/google" this issue was resolved. |
Beta Was this translation helpful? Give feedback.
-
I am having too the same problem using Next 12.1.6 with In our config we use
Even when the |
Beta Was this translation helpful? Give feedback.
-
We observe this error frequently in prod. |
Beta Was this translation helpful? Give feedback.
-
Had same problem with this on "next": "^13.4.5-canary.6", when I was using localhost it was Ok, after deploying it on vercel i recieve this error after login attemp |
Beta Was this translation helpful? Give feedback.
-
Having the same issue after upgrading to 1.20 from 1.15. Anyone from next auth understand whats changed between these versions? |
Beta Was this translation helpful? Give feedback.
-
One thing that can also cause this error is if your environment variable |
Beta Was this translation helpful? Give feedback.
-
My steps:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hi everyone, hope my answer will help to everyone. We work with Keycloak. Our config looks like this:
So why I added cookies to config? In this case we do not need to turn off 'checks' in config. We also do redirect from nextauth signin page to our custom signin page with nice design. |
Beta Was this translation helpful? Give feedback.
-
To me, fixing the DNS addresses of the network solved the issue. I was using the following: 1.1.1.1, 8.8.4.4. After hours of trying to resolve it, I decided to change the DNS to: 8.8.8.8 and 8.8.4.4, and finally it worked. Maybe because I was using Cloudflare and Google as DNS. |
Beta Was this translation helpful? Give feedback.
-
Same issue with Keycloak |
Beta Was this translation helpful? Give feedback.
-
Same issue with vercel: [OAUTH_CALLBACK_ERROR] State cookie missing when using Google OAuth provider Description Steps to Reproduce
Error Details
Environment |
Beta Was this translation helpful? Give feedback.
-
everything was working fine for me with version |
Beta Was this translation helpful? Give feedback.
-
@dennis-gonzales has the answer that worked for me. In my case I had been on an old version that was also broken.
|
Beta Was this translation helpful? Give feedback.
-
FWIW, I'm seeing this same issue in my error logs for other users, despite it working correctly for myself (i.e. I can log in via different accounts successfully in my app). Error:
I'm using:
|
Beta Was this translation helpful? Give feedback.
-
I fixed my issue removing |
Beta Was this translation helpful? Give feedback.
-
This solution worked for me
|
Beta Was this translation helpful? Give feedback.
-
For me, due to mismatch between localhost and 127.0.0.1, my and Make sure the |
Beta Was this translation helpful? Give feedback.
-
fixed the problem! My NEXTAUTH_URL and callback URL were correct, but the issue arose from using the following <Link href="/api/auth/callback/github">Login with GitHub</Link> I changed the link to use the signIn function from next-auth/react: import { signIn } from 'next-auth/react';
<Button onClick={() => signIn()}>Login with GitHub</Button> Advice for Similar Issues If you encounter a similar problem in your codebase, here are some tips to consider:
Feel free to let me know if you need any further assistance! |
Beta Was this translation helpful? Give feedback.
-
I have the problem with Nuxt and Sidebase-auth which are based on Next-auth 4. Can someone explain me why the state cookie is not created and how to solve the problem without having to disable checks because it is a big security flaw? |
Beta Was this translation helpful? Give feedback.
-
import NextAuth, { NextAuthOptions, Profile } from 'next-auth' interface TokenPayload { const apiVersion = '5.131' export const authOptions: NextAuthOptions = {
],
}, export default NextAuth(authOptions) на localhost:3000 работает но на дев окружении не работает и все настройки правильно сделаны
|
Beta Was this translation helpful? Give feedback.
-
OK I have been having this error for awhile and after diving into it the issue seems to be due to a misconfiguration on Nginx in conjunction with a misconfiguration in the auth provider cookies section.
HTH |
Beta Was this translation helpful? Give feedback.
-
Question 💬
Using AzureAdProvider for authentication
I have tried giving authorization params as well
Getting the error
How to reproduce ☕️
To reproduce use the above authOptions for azure ad, and use it in pages/api/auth/[...nextauth].ts file as specified in the docs.
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions