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

make request token method Trelll compatible #832

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion social_core/backends/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ def request_token_extra_arguments(self):
def unauthorized_token(self):
"""Return request for unauthorized token (first stage)"""
params = self.request_token_extra_arguments()
params.update(self.get_scope_argument())
if self.name not in ['trello']:
params.update(self.get_scope_argument())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is really needed, overriding get_scope_argument in TrelloOAuth is the way to go.

Copy link
Author

@bs-bhagirath-radadiya bs-bhagirath-radadiya Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trello REQUEST_TOKEN_URL (https://trello.com/1/OAuthGetRequestToken) does not take any arguments.

If we send the scope here then the URL looks like this https://trello.com/1/OAuthGetRequestToken?scope=read,write

As per above mentioned Trello request does not take any arguments in REQUEST_TOKEN_URL. Trello gives an error like this...

ERROR: 400 Client Error: Bad Request for URL: https://trello.com/1/OAuthGetRequestToken?scope=read%2Cwrite

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this should go as a comment to the code. And the implementation should override get_scope_argument method in TrelloOAuth instead of doing changes in generic OAuth backend.

key, secret = self.get_key_and_secret()
state = self.get_or_create_state()
response = self.request(
Expand Down