nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
24.06k stars 3.33k forks source link

Twitter callback URI error #8630

Closed Grinyaka closed 5 months ago

Grinyaka commented 11 months ago

Provider type

Twitter

Environment

System: OS: Linux 5.15 Linux Mint 21.2 (Victoria) CPU: (16) x64 AMD Ryzen 7 4800H with Radeon Graphics Memory: 11.50 GB / 15.04 GB Container: Yes Shell: 5.1.16 - /bin/bash Binaries: Node: 16.14.1 - /usr/local/bin/node Yarn: 1.22.1 - ~/.yarn/bin/yarn npm: 8.5.0 - /usr/local/bin/npm pnpm: 6.11.0 - /usr/local/bin/pnpm Browsers: Chromium: 115.0.5790.170

Reproduction URL

https://next-auth-example.vercel.app/

Describe the issue

Even on next-auth example page, when I'm trying to sign in with twitter, I get error "Try signing in with a different account." image image

I have three similar projects: 1) using Privy (with twitter oAuth2), 2) using passport-twitter on express (oAuth1) and 3) using next auth. First two are working ok with same twitter credentials, but Twitter auth seems broken. image

How to reproduce

1) Go to https://next-auth-example.vercel.app/ 2) Try to sign in with Twitter

Expected behavior

I guess, the problem is in POST request, that sends callbackUrl without any "callback" mentions

sky4git commented 11 months ago

I am getting the 403 forbidden error as well. I am not sure issue is from Nextauth side or from Twitter. But I posted it here https://twittercommunity.com/t/getting-403-forbidden-oauth2-on-basic-plan/205949

I created a separate project with a simple Twitter provider using OAUTH version 2.0 without any adapters and jwt session strategy. I still get the same error.

balazsorban44 commented 5 months ago

Login with Twitter on https://next-auth-example.vercel.app/ should work now. Individual issues for your own case will need a reproduction.