Invalid access token exception not called while setting access token

Ntra
Ntra edited December 2017 in General
I see that the exception "Invalid access token" is not raised when set_access_token is called. But gets raised when kite calls are made.

According to your explanation that access tokens are valid for a day, I am trying to put in a system where if cached access token is invalid then the login flow is triggerred otherwise cached access token is used. But I don't get an exception if I use an expired access token in set_access_token call, so I can't trigger login flow.
  • sujith
    Hi,
    A set access token method will just set the variable in the Kite Connect object. It won't make any API call to validate your access token.
    A Kite Connect client will only come to know about access token validity after it makes an API call.
  • Ntra
    How do I check if the access token is valid then?
  • sujith
    sujith edited December 2017
    You can make any KiteConnect API call if it returns 403 then it means the session is expired.
Sign In or Register to comment.