Salesforce OAuth 2.0 Client Credentials Flow to get Access Token

Salesforce OAuth 2.0 Client Credentials Flow to get Access Token

1. Create a Connected App in Salesforce Setup under App Manager. Make sure “Enable Client Credentials Flow” is enabled on the Connected App.

Callback URL can be https://{Your Salesforce Domain}.my.salesforce.com/services/oauth2/callback.

Example:

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

2. Click Manage button on the Connected App.

3. Click Edit Policies.

4. Under “Client Credentials Flow” section, select the Run As.

5. For the Run As user, select the User with API Only enabled Permission.

6. Do a POST request to get the Access Token.

Request URL:

https://{Your Salesforce Domain}.my.salesforce.com/services/oauth2/token

Leave a Reply