function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Carl PierreCarl Pierre 

Problem Getting Refresh token with test account

Hi,

I have a test account I'm not able to resfresh my token

This is the endpoint used

https://test.salesforce.com/services/oauth2/token

for grant_type I use refresh_token
for refresh_token I use the resfresh token received with my token

it always returns the same token that is now expired

This is an example of how the response looks like:

{
    "access_token": "00oo0mYw_3k3lGCdtt4TC_TqD6ojIZmHyXCIWAHzYQPY349cnN2I4444",
    "signature": "Zp8Z2+TYKG+000UsO5zXg47mGUBLAHUEAEPMk8pEE=",
    "scope": "refresh_token visualforce wave_api web custom_permissions openid chatter_api id api full",
    "instance_url": "https://c00-De.cs42.my.salesforce.com",
    "id": "https://test.salesforce.com/id/00D550222006Dz6EAE/00555000001BQFxAAO",
    "token_type": "Bearer",
    "issued_at": "7777777"
}
Daniel BallingerDaniel Ballinger
So the access_token that comes back is the same one you had prior to requesting the refresh? And it has expired?

Do you see any changes occuring in the User Session Information (https://help.salesforce.com/HTViewHelpDoc?id=security_user_session_info.htm&language=en_US)? Perhaps a change in the Valid Until value for one of the Sessions?
Carl PierreCarl Pierre
Yes the access_token that comes back is the same one I had prior to requesting the refresh and it has expired.

Yes I'm able to see changes occuring in the User Session

User-added image
Daniel BallingerDaniel Ballinger
Can you try an explicitly revoke the current token that comes back before refreshing? This might force the refresh to occur.
Revoking OAuth Tokens (https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_revoke_token.htm&language=en)