Re-use token not working for smartconnect.


  • Re-use token not working for smartconnect.

    I am saving the tokens in my database during first login but when i try to re-use the token next time it is not working. I tried the following:
    obj.setRefreshToken(<previously fetched refresh token>)
    obj.setFeedToken(<previously fetched feed token>)
    obj.setAccessToken(<previously fetched JWT token>)

    still i get error as invalid token.
    Previous blogs have broken links and no proper information. Kindly respond. thanks!


  • @thiyagaraaj token expires automatically and need to relogin again.
    In my case, I have implemented totp verification with the totp secret, which helps me login everyday automatically. You can try it too. https://pyauth.github.io/pyotp/


  • hi @thiyagaraaj

    Apologies for delayed response.
    JWT token gets expired every 24-28 hrs and we require to the client to login everyday to consume the smartAPI. Please fetch the recent token after login and let us know if the issue still occurs.

    Thanks & Regards,
    SmartAPI team