Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OAuth 2.0 user authentication #16

Merged
merged 10 commits into from
Apr 2, 2022
Merged

Add OAuth 2.0 user authentication #16

merged 10 commits into from
Apr 2, 2022

Conversation

daneden
Copy link
Owner

@daneden daneden commented Mar 30, 2022

Fixes #11. This PR adds OAuth 2.0 user authentication, including automatic token refreshing and deprecation of OAuth 1.0a authentication methods.

To do:

  • Fix Deprecate methods that rely on OAuth 1.0a (media methods). Unfortunately media methods don't support OAuth 2.0 authentication. When Twitter eventually adds V2 media endpoints, they might have a different API which means that both Twift's current media methods and new ones might coexist; I'll plan to mark the current method as deprecated in advance of this change.
  • Test that OAuth 2.0 works as expected on all methods
  • Add scope checks for methods. Most (all?) OAuth 2.0 endpoints have specific scopes that can use them. To save network trips, it might be nice to throw errors when an attempt is made to call a method with the wrong scope. Decided against this as it would just end up adding layers of misdirection between the library and Twitter's API; Twitter's errors should be enough to communicate insufficient scope errors.

@daneden daneden merged commit 17b65be into main Apr 2, 2022
@delete-merged-branch delete-merged-branch bot deleted the feat-oauth2 branch April 2, 2022 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add OAuth 2.0 User Authentication Support
1 participant