Skip to content

feat: automate access token generation via TOTP and PIN (#41, #24)#44

Open
SHIVANIUM-GIT wants to merge 1 commit into
FyersDev:sample_v3from
SHIVANIUM-GIT:fix/access-token-generate
Open

feat: automate access token generation via TOTP and PIN (#41, #24)#44
SHIVANIUM-GIT wants to merge 1 commit into
FyersDev:sample_v3from
SHIVANIUM-GIT:fix/access-token-generate

Conversation

@SHIVANIUM-GIT
Copy link
Copy Markdown

This PR addresses the manual access token generation bottleneck by introducing a fully automated authentication flow. Instead of manually capturing the auth_code from a browser URL, this script handles the entire process—including TOTP generation and PIN verification—programmatically.

Fixes #41
Fixes #24

Changes Made

  • New Automation Script: Added v3/python/login/automate_access_token.py which automates the login flow, OTP verification (via pyotp), and PIN entry to generate an access token.
  • Environment Template: Added v3/python/.simple.env to provide a clear template for required credentials (client_id, secret_key, totp_key, etc.).
  • Security Update: Updated .gitignore to ensure users don't accidentally commit their private .env files containing real credentials.
  • Automatic Persistence: The script automatically saves the generated token back into the .env file for immediate use by other scripts.

How to Test

  1. Rename .simple.env to .env and fill in your Fyers API credentials.
  2. Run python v3/python/login/automate_access_token.py.
  3. Verify that the access_token field in your .env is updated automatically without any manual browser interaction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

issue in generating access token Issue in generating access_token

1 participant