How to detect session disconnect?

sumit.ssr207
In developing desktop application, It has mentioned that webview needs to be opened for authentication and should be closed when we get request_token. Now suppose user logs in other computer/mobile or any what so ever reasons this session gets disconnect then how will my desktop app know about it? because It will always place requests based on what request_token it has received. To resolve this there must be some mechanism to periodically check whether api session is continue or lost. Now what best/cpu not so intensive approach you will suggest for this activity?
  • Kailash
    Once you get the request_token, you will exchange it for an access_token. The access_token is what is used for every subsequent request.

    If any request, at any point gets a "TokenException" (HTTP code 403), it means the session has been terminated. The exception/error JSON structure is documented here https://kite.trade/docs/connect/v1/#response-structure
Sign In or Register to comment.