Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    How to generate session when login is made through url?

    Python SDK
    0
    1
    2
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sunnysingh123987 last edited by

      from SmartApi import SmartConnect
      api_key = "#####"

      smartapi = SmartConnect(api_key)

      login-url = smartapi.login_url()

      # user is logged in using login url here and required tokens are collected using redirect url

      #session = smartapi.generate_session(clientid,pwd,totp) <-- cannot be used!
      profile = smartapi.get_profile() <-- Throws error: AG8001

      Note: This is a simiplified version of code to understand the proccess.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post