Generate Salesforce refresh_token

In order to generate the Salesforce refresh_token, we have to first generate the Authorization Code. Using the Authorization Code, we can make subsequent POST request to get the Salesforce refresh token.

Please check the following steps for reference.

1. Create a Connected App.

2. Construct and open the URL in your Browser.

Syntax:

https://<My_Domain_URL>/services/oauth2/authorize?response_type=code&client_id=<Consumer_Key>&redirect_uri=<Callback_URL>

Example:

https://infallibletechie2-dev-ed.develop.my.salesforce.com/services/oauth2/authorize?response_type=code&client_id=3MVG9Rr0EZ2YOVMZWj6wx21i42UYE5IlWFus9OkQk8TWkLpaxKRFhNwPfPORuWIZjHU1z8I3r5AuOE6Q4ic5x&redirect_uri=https://login.salesforce.com

3. Click Allow Access to generate the Authorization Code.

4. Note down the code value from the URL.

5. Make a POST Request.

Request Endpoint:

Syntax:

https://<My_Domain_URL>/services/oauth2/token

Example:

https://infallibletechie2-dev-ed.develop.my.salesforce.com/services/oauth2/token

Leave a Reply