0

I have successfully got the access_token and the refresh_token from a Web Flow OAuth2. My scope do include full and refresh_token.

The issue I have now is that when I login after with server to server API communication, I can use the refresh_token to get a new access_token when I POST to /services/oauth2/token and I do get a response from Salesforce. The problem is that in the return response there is no refresh_token returned from /services/oauth2/token.

Has anyone run into this issue to get refresh_token from /services/oauth2/token?

Thanks.

1

The refresh token is "permanent", meaning it lasts until it is revoked or manually logged out. You do not need to get a new refresh token every time you get a new access token. You can use the refresh token to get as many new access tokens as you'd like. Note that the system prefers to return an existing, non-expired access as opposed to a new one when you use the same refresh token. In other words, if you do a refresh, and it's the same token, the previous token has been refreshed instead of being issued a new token. As a developer, you don't really need to be concerned about this implementation detail. Just remember that you only need a single refresh token, and you can refresh your access token any time you'd like.

  • Thanks sfdcfox. I always thought that the refresh_token also need to be refreshed too. Many thanks for your help. – user1886205 Nov 15 '17 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.