Skip to content

Commit

Permalink
fix(twitter_oauth2): Fixed Twitter OAuth2 authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
gschurck authored Aug 4, 2023
1 parent 00c9bc9 commit 13a9a71
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ George Whewell
Griffith Rees
Guignard Javier
Guilhem Saurel
Guillaume Schurck
Guillaume Vincent
Guoyu Hao
Haesung Park
Expand Down
2 changes: 2 additions & 0 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Note worthy changes

- Added support for SAML 2.0.

- Fixed Twitter OAuth2 authentication by using basic auth and adding scope `tweet.read`.


Security notice
---------------
Expand Down
2 changes: 1 addition & 1 deletion allauth/socialaccount/providers/twitter_oauth2/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_fields(self):
return settings.get("FIELDS", default_fields)

def get_default_scope(self):
return ["users.read"]
return ["users.read", "tweet.read"]


provider_classes = [TwitterOAuth2Provider]
1 change: 1 addition & 0 deletions allauth/socialaccount/providers/twitter_oauth2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class TwitterOAuth2Adapter(OAuth2Adapter):
access_token_url = "https://api.twitter.com/2/oauth2/token"
authorize_url = "https://twitter.com/i/oauth2/authorize"
profile_url = "https://api.twitter.com/2/users/me"
basic_auth = True

def complete_login(self, request, app, access_token, **kwargs):
extra_data = self.get_user_info(access_token)
Expand Down

0 comments on commit 13a9a71

Please sign in to comment.