UpGuard scans cloud services on your behalf by first authenticating to an exposed API. The credentials required to successfully authenticate to a cloud service fall into either keypair or password based authentication categories. Where possible, UpGuard will only request what API access it actually needs.

Prerequisites

  • You will need a Salesforce account.

Adding

  1. Log into UpGuard and click Add Node.
  2. From the node select screen click Cloud Services and then select Salesforce from the dropdown list.

    w500

    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.
  3. Once you have located these credentials (see below), click Continue to add the node and kick off a node scan.

Instance Name

Your Salesforce instance name can found in the URL of your browser address bar after you login.

w200

In the above example it would be na17.

Consumer Key and Consumer Secret

  1. 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.

    salesforce-03

  2. Enter in the following required information (using your contact email address). Click Save to continue.

    salesforce-04

  3. The Consumer Key and Consumer Secret can then be viewed under the “API (Enable OAuth Settings)” heading.

    salesforce-05

Password plus Security Token

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.

salesforce-06

cURL Examples

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 "username=mylogin@salesforce.com" \
-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"
Tags: token key