diff --git a/liberapay/elsewhere/_base.py b/liberapay/elsewhere/_base.py index d5b77cc5f..9a3b2fe4c 100644 --- a/liberapay/elsewhere/_base.py +++ b/liberapay/elsewhere/_base.py @@ -500,6 +500,7 @@ class PlatformOAuth2(Platform): oauth_default_scope = [] oauth_email_scope = None oauth_follows_scope = '' + oauth_include_client_id = None can_auth_with_client_credentials = None use_basic_auth_for_app_session = False @@ -561,9 +562,10 @@ def get_query_id(self, querystring): def handle_auth_callback(self, domain, url, state, unused_arg): sess = self.get_auth_session(domain, state=state) client_secret = self.get_credentials(domain)[1] - sess.fetch_token(self.access_token_url.format(domain=domain), - client_secret=client_secret, - authorization_response=url) + sess.fetch_token( + self.access_token_url.format(domain=domain), client_secret=client_secret, + authorization_response=url, include_client_id=self.oauth_include_client_id, + ) return sess diff --git a/liberapay/elsewhere/twitch.py b/liberapay/elsewhere/twitch.py index 406c151d5..338401fb1 100644 --- a/liberapay/elsewhere/twitch.py +++ b/liberapay/elsewhere/twitch.py @@ -14,6 +14,7 @@ class Twitch(PlatformOAuth2): # Auth attributes # https://dev.twitch.tv/docs/authentication/ auth_url = 'https://id.twitch.tv/oauth2/authorize' + oauth_include_client_id = True access_token_url = 'https://id.twitch.tv/oauth2/token' can_auth_with_client_credentials = True