Can't Sign in , error expected 200 OK, got: 403 Forbidden. #8323
Replies: 22 comments 14 replies
-
We have the same issue |
Beta Was this translation helpful? Give feedback.
-
i have same issue |
Beta Was this translation helpful? Give feedback.
-
I'm also facing the same issue. |
Beta Was this translation helpful? Give feedback.
-
Got exactly the same issue. Can anyone help please? Been playing around with these for already 2 days. |
Beta Was this translation helpful? Give feedback.
-
I also have the same issue,and I noticed they mentioned this error in their doc here. However, I am using node v20.5.0. In my case my Twitter Auth worked fine while my Linkedin Auth failed.
|
Beta Was this translation helpful? Give feedback.
-
Since I saw that Google Authentication was working in my old server with exactly the same configuration as the new one, I guess that the issue comes from google, not allowing to have a new IP for the same URL. Can someone verify this? |
Beta Was this translation helpful? Give feedback.
-
Another update: I migrated my project to Vercel and google authentication works perfect. It seems like if google had blocked the server IP address that I was using, but seems really strange since it was a new one issued by IONOS. It could also be the server configuration I had with NGINX, but seems also pretty strange as it was the same as in my old server. |
Beta Was this translation helpful? Give feedback.
-
Having the same problem with nextjs 12.x.x, nextjs 13.x.x with next-auth 4.x.x |
Beta Was this translation helpful? Give feedback.
-
I have this issue with LinkedIn. (so far only on localhost) Any update? |
Beta Was this translation helpful? Give feedback.
-
Running into this issue with LinkedIn. |
Beta Was this translation helpful? Give feedback.
-
Either callback URLs are not configured correctly or the provider takes time to adapt changes. I had same problem and it fixed it self after waiting about an hour. |
Beta Was this translation helpful? Give feedback.
-
the issue with google cloud |
Beta Was this translation helpful? Give feedback.
-
same error |
Beta Was this translation helpful? Give feedback.
-
I was having a similar issue with LinkedIn, and was able to work around it with some adjusted provider configuration: LinkedInProvider({
clientId: process.env.LINKEDIN_CLIENT_ID,
clientSecret: process.env.LINKEDIN_CLIENT_SECRET,
idToken: true,
wellKnown:
"https://www.linkedin.com/oauth/.well-known/openid-configuration",
authorization: {
params: {
scope: "openid profile email",
},
},
issuer: "https://www.linkedin.com",
jwks_endpoint: "https://www.linkedin.com/oauth/openid/jwks",
profile: (profile) => {
return {
id: profile.sub,
name: profile.name,
firstname: profile.given_name,
lastname: profile.family_name,
email: profile.email,
image: profile.picture,
};
}, I was having similar issues with Twitter until I moved the standalone app that was created for me into a project - the issue of the 403 was essentially because the app was standalone, and my access for auth was configured for a project (which had no apps in it). I moved the app into the project and it seems to have resolved the issue. This is all with the free tier, and auto-generated project and app that came when I signed up for twitter dev access. |
Beta Was this translation helpful? Give feedback.
-
same issue |
Beta Was this translation helpful? Give feedback.
-
I was having this issue with Spotify provider. Then realised it was because i was in development mode and have to add users on the spotify api dev console that can be authorised while still in dev mode or you get the 403 forbidden error. |
Beta Was this translation helpful? Give feedback.
-
I have same issue too! |
Beta Was this translation helpful? Give feedback.
-
Google has restricted some countries, to fix the problem, you can use V.PN |
Beta Was this translation helpful? Give feedback.
-
Even with using a VPN, I have this problem! |
Beta Was this translation helpful? Give feedback.
-
After spending a lot of hours, I find out it is not related to sanctions. I upgraded to authjs v5 and after the upgrade everything works well. |
Beta Was this translation helpful? Give feedback.
-
i have same issue |
Beta Was this translation helpful? Give feedback.
-
i have same issue |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
"next": "13.4.10",
"next-auth": "^4.22.1",
Reproduction URL
.
Describe the issue
[next-auth][error][OAUTH_CALLBACK_ERROR]
https://next-auth.js.org/errors#oauth_callback_error expected 200 OK, got: 403 Forbidden {
error: OPError: expected 200 OK, got: 403 Forbidden
at processResponse (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/helpers/process_response.js:37:15)
at eval (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/helpers/issuer.js:40:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Issuer.queryKeyStore (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/helpers/issuer.js:68:22)
at async Client.validateJWT (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/client.js:947:20)
at async Client.validateIdToken (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/client.js:637:53)
at async Client.callback (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/client.js:417:13)
at async oAuthCallback (webpack-internal:///(sc_server)/./node_modules/next-auth/core/lib/oauth/callback.js:118:22)
at async Object.callback (webpack-internal:///(sc_server)/./node_modules/next-auth/core/routes/callback.js:18:79)
at async AuthHandler (webpack-internal:///(sc_server)/./node_modules/next-auth/core/index.js:202:38)
at async NextAuthRouteHandler (webpack-internal:///(sc_server)/./node_modules/next-auth/next/index.js:49:30)
at async NextAuth._args$ (webpack-internal:///(sc_server)/./node_modules/next-auth/next/index.js:83:24)
at async eval (webpack-internal:///(sc_server)/./node_modules/next/dist/server/future/route-modules/app-route/module.js:253:37) {
name: 'OAuthCallbackError',
code: undefined
},
providerId: 'google',
message: 'expected 200 OK, got: 403 Forbidden'
}
[next-auth][error][OAUTH_CALLBACK_ERROR]
https://next-auth.js.org/errors#oauth_callback_error expected 200 OK, got: 403 Forbidden {
error: OPError: expected 200 OK, got: 403 Forbidden
at processResponse (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/helpers/process_response.js:37:15)
at eval (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/helpers/issuer.js:40:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Issuer.queryKeyStore (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/helpers/issuer.js:68:22)
at async Client.validateJWT (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/client.js:947:20)
at async Client.validateIdToken (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/client.js:637:53)
at async Client.callback (webpack-internal:///(sc_server)/./node_modules/openid-client/lib/client.js:417:13)
at async oAuthCallback (webpack-internal:///(sc_server)/./node_modules/next-auth/core/lib/oauth/callback.js:118:22)
at async Object.callback (webpack-internal:///(sc_server)/./node_modules/next-auth/core/routes/callback.js:18:79)
at async AuthHandler (webpack-internal:///(sc_server)/./node_modules/next-auth/core/index.js:202:38)
at async NextAuthRouteHandler (webpack-internal:///(sc_server)/./node_modules/next-auth/next/index.js:49:30)
at async NextAuth._args$ (webpack-internal:///(sc_server)/./node_modules/next-auth/next/index.js:83:24)
at async eval (webpack-internal:///(sc_server)/./node_modules/next/dist/server/future/route-modules/app-route/module.js:253:37) {
name: 'OAuthCallbackError',
code: undefined
},
providerId: 'google',
message: 'expected 200 OK, got: 403 Forbidden'
}
How to reproduce
.
Expected behavior
.
Beta Was this translation helpful? Give feedback.
All reactions