- You will need a Salesforce account.
- Log into UpGuard and click Add Node.
From the node select screen click Cloud Services and then select Salesforce from the dropdown list.
Field Salesforce cURL Description Instance Name Component of token request URL Identifies the Salesforce instance to which API calls should be sent. Consumer Key client_id The Consumer Key from the connected app definition. Consumer Secret client_secret The Consumer Secret from the connected app definition. Username username Your Salesforce login username. Password password Your Salesforce login password + your security token.Note:
UpGuard uses the Username-Password OAuth Authentication Flow.
- Once you have located these credentials (see below), click Continue to add the node and kick off a node scan.
Your Salesforce instance name can found in the URL of your browser address bar after you login.
In the above example it would be
Consumer Key and Consumer Secret
To obtain these credentials, you will need to add UpGuard as a connected app to your Salesforce instance. To do this, log into your Salesforce account and click on Create then Apps from the submenu. On the Apps page to the right of the Connected Apps heading, click on New to create a new connected app.
Enter in the following required information (using your contact email address). Click Save to continue.
The Consumer Key and Consumer Secret can then be viewed under the “API (Enable OAuth Settings)” heading.Important:
Allow from 2-10 minutes for your changes to take effect on the server before using the connected app.
Password plus Security Token
You must append your security token to your password. A security token is an automatically-generated key from Salesforce. For example, if your password is "abc", and your security token is "123", then the value provided for the password credential must be "abc123".
Unfortunately, retrieving your security token (if it isn’t already recorded) in Salesforce is not possible. Instead, you must reset your security token (if you have never done so before) to receive one. Nice and intuitive. To do this, click on your name at the top of the screen and click on My Settings. Then from the left pane, click on Personal then Reset My Security Token. Your security token will then be emailed to you.
As per the warning, resetting your security token will require any existing connected apps that use this security token to be updated with the new one. If you have no other connected apps, then this is not an issue. If you do have existing connected apps then you should first check your inbox to see if you have already have a security token.
-d sets the POST parameter.
To request for an access token (used for subsequent requests)
curl https://login.salesforce.com/services/oauth2/token \ -d "grant_type=password" \ -d "client_id=myclientid" \ -d "client_secret=myclientsecret" \ -d "firstname.lastname@example.org" \ -d "password=mypassword123456"
List available REST resources
curl https://na1.salesforce.com/services/data/v26.0/ \ -H "Authorization: Bearer token"
List available objects
curl https://na1.salesforce.com/services/data/v26.0/sobjects/ \ -H "Authorization: Bearer token"