Have a probably stupid question here. In double checking the Authentication documentation, I know that it is mentioned that tokens must be refreshed moving forward. However, when reading the documentation for OAuth Implicit Code Flow (User Access Tokens), there isn’t a refresh token returned, it has only ever returned the access_token. Now, I know later it is mentioned that “application tokens cannot be renewed” but does that mean that this type of token does expire in X hours/days, without reporting back the expiration time?
From the docs:
If the user authorizes your application, she is redirected to your redirect URL:
https://#access_token=
The access token is in the URL fragment, not the query string, so it will not show up in HTTP requests to your server. URI fragments can be accessed from JavaScript with document.location.hash.
The response includes the nonce and state parameters, if they were in your request.
This is the type of token that I currently use in a couple of apps to obtain chat_login, for example, and I use when I lose the Oauth in Chatty. So that said, are these tokes of access_tokens also going to expire and if so, does this mean that I need to swap over to OAuth Authorization Code Flow (User Access Tokens) instead.
Implicit code flow is meant for entirely client-side applications and such applications generally run the user through the login flow once per session, and sessions are unlikely to last longer than the token does (at least that’s how it should be).
Right, that is my understanding of the flow, and what I use for generating Oauth for logging into chat with applications like Chatty. So, if it doesn’t expire, then great. Otherwise, I mean, that becomes a bit of a pain.
Is there any update on this? It seems that tokens for newly registered applications only last for a few hours.
This is a problem for clientside apps which don’t live in the web, because users have to open a browser to authenticate again. It’s just not practical to ask users to do that, especially during a stream (which can easily last longer than a few hours). And getting a refresh token isn’t an option because it requires a client secret (Authorization flow), which can never be stored securely in a clientside application (at best it would be obscured in some way, e.g. by being compiled).