From 3a56aecc9e5b1ba9466e95ab1d9eb788d797ae97 Mon Sep 17 00:00:00 2001 From: Abhishek Verma <40134208+w3Abhishek@users.noreply.github.com> Date: Thu, 25 Dec 2025 19:32:48 +0530 Subject: [PATCH] Add client_secret to OAuth2PKCEAuth instance client_secret is required for working with OAuth 2.0 in X API. Without it you'll get the following error when calling fetch_token() function: ValueError: HTTP error! status: 401, body: {'error': 'unauthorized_client', 'error_description': 'Missing valid authorization header'} Signed-off-by: Abhishek Verma <40134208+w3Abhishek@users.noreply.github.com> --- xdks/python/authentication.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/xdks/python/authentication.mdx b/xdks/python/authentication.mdx index 7f7fb1ca..b55cb748 100644 --- a/xdks/python/authentication.mdx +++ b/xdks/python/authentication.mdx @@ -48,6 +48,7 @@ import webbrowser # Step 1: Create PKCE instance auth = OAuth2PKCEAuth( client_id="YOUR_CLIENT_ID", + client_secret="YOUR_CLIENT_SECRET", redirect_uri="YOUR_CALLBACK_URL", scope="tweet.read users.read offline.access" )