Skip to main content Stream TDX Bengaluru on Salesforce+. Start learning the critical skills you need to build and deploy trusted autonomous agents with Agentforce. Register for free.
I am testing OAuth integration with my App. Everything was going fine until over the weekend I lost my refresh tokens for my test accounts.

Now I am receiving this error:

{"error":"invalid_grant","error_description":"expired authorization code"}

The redirect back returns a code. This code never changes. However, this code is deemed expired once I try to request an access token and refresh token. I imagine this is because the initial access token has expired and I need to use the refresh token to gain a new one. However, I do not have access to the original refresh tokens.

My question is, how to I reset this whole thing? I have tried the following in all possible combinations:

- In the client login, revoked oauth access to all apps

- In the client login, Reset API Key

- In the developer login, modify redirect_uri

- In the developer login, completely delete exisiting app and create a new one. The new app gives the same error.

I would just like to get both the Client Login and Developer Login App reset to square one. Then I can request my access and refresh tokens and, this time, reliably store them.
4 answers
  1. Mar 4, 2021, 12:42 PM
    Hi @Andee The concept for getting refresh token it changed now I belive. 

    You can get refresh token but in two steps

    1. Get code  : https://MYORG.my.salesforce.com/services/oauth2/authorize?response_type=code&client_id=XXXXX&redirect_uri=XXX&state=mystate

    2. Use the code to get refresh token :  granttype = authorization_code pass code as parameter remember code can be used only once check the documentation then you will get refresh token. Also the connected all scope should have refresh token
Loading
0/9000