daneden / Twift

šŸ¦ An async Swift library for the Twitter v2 API šŸš§ WIP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add OAuth 2.0 User Authentication Support

daneden opened this issue Ā· comments

The Bookmarks API requires OAuth 2.0 support, and it seems like other APIs will follow suit in the future.

Twift v0 was primarily designed for use with OAuth 1.0a which, in retrospect, was probably a mistake. The library will need to support OAuth 2.0 user authenticationā€”maybe even deprecate 1.0a in order to simplify the library and its usage.

#16 will add OAuth 2.0 user auth support and mark OAuth 1.0a auth as deprecated, maybe even remove it, but I discovered that Twitter's v1.1 API methods (namely the media methodsā€”the only 1.1 methods in this library) donā€™t support OAuth 2.0 auth at all. So I have a choice:

  1. Only support OAuth 2.0 and wait until Twitter releases v2 media endpoints
  2. Support both OAuth 2.0 and 1.0a which requires more maintenance and probably leads to a confusing engineering experience when using the library since some methods will not support one or the other auth type
  3. Only support OAuth 1.0a and as a result, limit the API endpoints that can be used.

Option (1) above seems the best route forward.