What happens if you use an invalid refresh token?

What happens if you use an invalid refresh token?

If the application attempts to use an invalidated refresh token, an invalid_grant error response is returned.Here is the link for more documentation. As everyone is telling you as far as I know that error could be caused by 2 reasons:

Why does my OAuth2 invalid Grant not refresh?

I am trying to build a server that will populate Salesforce through a front end website using Express JS with JSForce library. However, every time the access token expired, it does not refresh by itself. The connection instructor already has refreshToken in it and I already did Oauth2 Flow. Below is the code to establish connection.

When does a refresh token expire in OAuth?

The refresh token represents the user’s authorization to the application, and is valid until explicitly revoked by the user, via My Settings ➤ Personal ➤ Advanced User Details ➤ OAuth Connected Apps. The refresh token may have an indefinite lifetime, persisting for an admin-configured interval or until explicitly revoked by the end-user.

How do I refresh my access token in Salesforce?

The easiest way to refresh the access token is just to open the scratch org via Salesforce DX. From the command palette, you can do > SFDX: Open Default Org. Or, from the integrated terminal, do. sfdx force:org:open.

Is there a limit to refresh tokens on OAuth?

Your server’s clock is not in sync with network time protocol – NTP. The refresh token limit has been exceeded. The limit for each unique pair of OAuth 2.0 client and Google Analytics account is 25 refresh tokens.

What to do if your sfdx access token has expired?

From the command palette, you can do > SFDX: Open Default Org. Or, from the integrated terminal, do Once you do so, any other functionality you might use that depends on getting an access token via SFDX should work again, provide the scratch org is not expired.

How to add a refresh token to an app?

Your app needs permissions (scope) to have the ability to use refresh tokens. In Setup > Quick Find > App Manager >, click the “Edit” link for your Connected App and add the scope “Perform requests on your behalf at any time (refresh_token, offline_access)”.