iostokeninstagramexpired-sessions

How come instagram iOS app never ask me login again, even token is expired?


I have been searching this for days..... I know usually when we design token for client and server, user can login with username and password, server use them to create a token and send back. If token is expired, we let user login again.

How come when I use instagram and never see it needs me login again? How do they handle this on their mobile app?

Your help will be highly appreciated.


Solution

  • Instagram says:

    Note that we do not include an expiry time. Our access_tokens have no explicit expiry, though your app should handle the case that either the user revokes access or we expire the token after some period of time. In this case, your response’s meta will contain an “error_type=OAuthAccessTokenError”. In other words: do do not assume your access_token is valid forever.

    If the token is somehow expired then they request for a new one, but that should be a rare case as instagram says they do no include an expiry time.

    For more info read this. Hope this helps.. :)