Skip to content

feat: add OAuth1 PIN-based token save script#9

Open
yasaka57 wants to merge 1 commit intoxdevplatform:masterfrom
yasaka57:master
Open

feat: add OAuth1 PIN-based token save script#9
yasaka57 wants to merge 1 commit intoxdevplatform:masterfrom
yasaka57:master

Conversation

@yasaka57
Copy link
Copy Markdown

Summary

  • Adds save_tokens.py: a one-time helper that runs the OAuth1 PIN-based consent flow and writes X_OAUTH_ACCESS_TOKEN / X_OAUTH_ACCESS_TOKEN_SECRET directly into .env
  • Enables automated or scheduled scripts to authenticate with static credentials, without re-running the browser-based OAuth flow on every execution
  • No new dependencies — uses requests-oauthlib and python-dotenv already listed in requirements.txt

How it works

  1. python save_tokens.py
  2. Open the printed URL in a browser and authorize the app
  3. Paste the displayed PIN into the terminal
  4. Tokens are written to .env automatically

Test plan

  • Confirm X_OAUTH_ACCESS_TOKEN and X_OAUTH_ACCESS_TOKEN_SECRET are populated in .env after running the script
  • Confirm a subsequent createPosts call succeeds with the saved credentials without re-running the flow

🤖 Generated with Claude Code

Adds save_tokens.py to obtain OAuth1 access tokens interactively
(PIN-based flow) and persist them directly into .env, enabling
automated scripts to use static credentials without re-running the
full OAuth consent flow each time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants