Search code examples
pythonoauth-2.0oauthtweepytwitter-oauth

Tweepy OAuth 2.0 Authorization Code Flow with PKCE Native App - what values do I use for Callback URI/Redirect URL & Website URL?


I am trying to do OAuth 2.0 Authorization Code Flow with PKCE (User Context) using Tweepy

While setting this up in the Twitter Developer Portal, I choose Type of App as Native App

Type of App

But I still get asked for Callback URI/Redirect URL & Website URL?

URIs & URLs

Since it's a native app, I am not sure what values I give here. I am trying to build a non-UI console app which will run from the command line - i.e. no URLs & no UIs.


Solution

  • If you are sure that you can not use the classic 3-legged OAuth process, you will have to use a PIN-based authorization (see the Tweepy documentation here).

    So, since you have to use "oob" as a callback URL in your code, I would suggest you to try to do the same in that dashboard page. If that does not work (which is the more likely hypothesis), you can probably set a lorem ipsum URL (for example http://localhost) since you will never use it.