Replies: 4 comments 1 reply
-
hey im having the same problem on local. did you ever figure this out? |
Beta Was this translation helpful? Give feedback.
-
Posting here since I'm having a similar error in 2023 and found this discussion via web search. I have a different call stack. https://next-auth.js.org/errors#oauth_callback_error no access token provided {
error: TypeError: no access token provided
at Client.requestResource (webpack-internal:///(rsc)/./node_modules/.pnpm/openid-client@5.4.3/node_modules/openid-client/lib/client.js:1017:19)
at Client.userinfo (webpack-internal:///(rsc)/./node_modules/.pnpm/openid-client@5.4.3/node_modules/openid-client/lib/client.js:1109:37)
at Object.request (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.22.5_next@13.4.13_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/providers/github.js:21:46)
at oAuthCallback (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.22.5_next@13.4.13_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/lib/oauth/callback.js:127:47)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.callback (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.22.5_next@13.4.13_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/routes/callback.js:18:79)
at async AuthHandler (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.22.5_next@13.4.13_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/index.js:202:38)
at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.22.5_next@13.4.13_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/next/index.js:50:30)
at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.22.5_next@13.4.13_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/next/index.js:84:24)
at async eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@13.4.13_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/future/route-modules/app-route/module.js:254:37) {
name: 'OAuthCallbackError',
code: undefined
},
providerId: 'github',
message: 'no access token provided'
} I had been running multiple app tests with same GH client id and key. The way I fixed it was to re-create a fresh OAuth application and use new credentials. 🤷 Running on next |
Beta Was this translation helpful? Give feedback.
-
Hey, I got the same problem like you that local test is normal,but got errors when deployed on the Vercel |
Beta Was this translation helpful? Give feedback.
-
Same issue. I did create a fresh app, and it worked. Doesn't make sense to me yet why that fixed it, but it did |
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.
-
Hi everyone,
Im pretty new to the OAuth world, but I know that you sometimes need a refresh_token / access_token.
Context: I am working on some Github OAuth with next-auth and everything was working fine locally: I made a local OAuth app on Github, made sure I had the secret and id in my .env and It worked as expected: I was able to log in.
But once I pushed it to vercel, it stopped working, first I had to put in a secret within the NextAuth section,
*
I did put the env values of the project within the vercel env(vercel project is from correct URL: production URL). local URL and vercel URL have different Github OAuth apps.OK, fixed that, then this happend:
I looked on Github for likewise issues or bugs, I even looked into the node_modules to trace where it came from, long story short: provider gets params, params get extracted into tokens, tokens get send to client (openid-client) and this throws the error shown above.
Any suggestion is appreciated!
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions