Angel One — direct API TOTP

Why this page is empty

Angel One's SmartAPI supports direct TOTP-based login via POST https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword. We pass {clientcode, password, totp} and get back a JWT. No browser, no OAuth redirect, no auth_code. So this callback page is a no-op for Angel — included for symmetry so the URL shape is consistent across the three brokers.

The page was loaded with ?ucc=callback, but no auth_code is needed for Angel.

What to do instead

The algotrade login ritual (backend/app/workers/login_ritual.py, scheduled at 07:30 IST) calls angel_login(...) from backend/app/brokers/angel/login.py, which:

  1. Reads the Angel account's encrypted TOTP secret from core.broker_accounts
  2. Generates the current 6-digit TOTP via pyotp.TOTP(secret).now()
  3. Calls SmartConnect.generateSession(clientCode, password, totp)
  4. Encrypts + persists the resulting jwtToken + refreshToken

No human in the loop, no Telegram prompt, no admin click.

← Back to home