pilcrowonpaper / arctic

OAuth 2.0 clients for popular providers
MIT License
976 stars 60 forks source link

Twitter authorization URL results in "Something Went Wrong" error #137

Closed michaelyoon closed 4 months ago

michaelyoon commented 4 months ago

I generate an authorization URL for Twitter like so:

const TWITTER_SCOPES = ['tweet.read', 'users.read', 'follows.read', 'follows.write'];

const state = generateState();
const codeVerifier = generateCodeVerifier();
const twitter = new Twitter(TWITTER_CLIENT_ID, TWITTER_CLIENT_SECRET, redirectURI);

const authUrl: URL = await twitter.createAuthorizationURL(state, codeVerifier, {
    scopes: TWITTER_SCOPES
});

When I click on that URL, I get this error:

Screenshot 2024-06-06 at 3 10 44 PM

I have double-checked my client ID and client secret in the Developer Portal.

I have also verified that my Callback URI is set correctly in the Portal:

Screenshot 2024-06-06 at 3 12 59 PM

Any suggestions on how to troubleshoot this would be much appreciated.

Thanks in advance.

pilcrowonpaper commented 4 months ago

Does your redirect_uri match the callback URI 1:1? If TWITTER_CLIENT_ID is an env var, is it actually defined?

michaelyoon commented 4 months ago

Thanks for getting back to me. I just came back here to ask you to close the issue, because I realized that my redirect_uri was missing the port number. Sorry, my dumb mistake. Closing this now.