Setup OAuth to Salesforce

This article describes the two ways we have tested to setup an OAuth connection to Salesforce fro RINT.

Pre-requisite 

This guide depends on that you already have a Connected App setup in Salesforce that RINT can connect to.

Follow this guide if that needs to be done: Setup Salesforce Connected App and API user for the integration

Steps

  1. Go to REST Integrations admin page (<baseurl>/secure/RestfulClientAction.jspa?view=auth)
  2. Click on Authentications (lock symbol)
  3. Select OAuth and enter a name 
  4. Select Grant Type from the two options below

Option A - Use Grant Type: Authentication Code

Benefits no password is shared or username

  1. On Authorize URL enter https://login.salesforce.com/services/oauth2/authorize?response_type=code
  2. On Access Token URL enter https://login.salesforce.com/services/oauth2/token
  3. On Client ID enter the ID that came from the  connected App (Setup Salesforce Connected App and API user for the integration)
  4. On Client Secret enter the secret that came from the connected App (Setup Salesforce Connected App and API user for the integration)
  5. Leave Scope blank
  6. Check Include state 
  7. Click Authorize
  8. This will prompt you with the consent form from Salesforce, enter username and password and press Agree.
  9. Done! You will see that the connection was successful if you have these two green labels next to the Authorize button
    AUTH CODE GRANTED
    ACCESS TOKEN GRANTED
 Click here to expand...

The next step is to setup a rest call that uses the above as authentication.


Option B - Use Grant Type: Resource Owner Password Credentials

Benefits - simpler

  1. On Access Token URL enter https://login.salesforce.com/services/oauth2/token
  2. On Client ID enter the ID that came from the  connected App (Setup Salesforce Connected App and API user for the integration)
  3. On Client Secret enter the secret that came from the connected App (Setup Salesforce Connected App and API user for the integration)
  4. Enter Salesforce user name (the user with API access)
  5. Enter the Salesforce password + personal security token. (Reset My Security Token)

     Click here to expand...

    It is very important that you enter the password+security token. example my password is abc and my security token is 123 then enter in the password field: abc123

  6. Leave Scope blank
  7. Leave Include state unchecked
  8. Click Authorize
  9. Done! You will see that the connection was successful if you have these two green labels next to the Authorize button
    ACCESS TOKEN GRANTED