+ Start a Discussion

Can't refresh the access token. The response comes with the old access token


According to this: http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com , once I get the 401 error ('Session expired or invalid'), I should be able to use the refresh token to obtain a new access token.


However, anytime I attempt to refresh the token, the response comes without error messages, but with the same old access token that is expired or invalid.



How can that be possible ? Isn't it supposed to return a new access token ?




What oauth scope are you using?




Access and manage yout data (api)

perform requests on your behalf at any time (refresh_token)  


I just realized that my real problem is that the API is returning the error "Session invalid or expired" kind of randomly. Even if the session is not really expired. That's why the response comes with the same old token when I try to refresh. It's super weird.