Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Latest commit

 

History

History
53 lines (39 loc) · 2.15 KB

development.md

File metadata and controls

53 lines (39 loc) · 2.15 KB

Development

This integration uses the Salesforce API for collecting data.

Prerequisites

Aside from what is documented in the README, no special tooling is required to run and test this integration.

Provider account setup

  1. Create a free developer account

  2. Add a Connected App

  • Ensure the following configurations are enabled:
    • Enable OAuth Settings (Checked)
    • Callback URL: 'https://login.salesforce.com/services/oauth2/success'
    • Policy : "Access and manage your data (api)" and "Perform requests on your behalf at any time (refresh_token, offline_access)"
    • Save consumer key and consumer secret
  1. Get Auth Code: Using postman you can hit the API(POST) with:

    curl --location --request POST 'https://jupiterone2-dev-ed.lightning.force.com/services/oauth2/authorize?%0Aclient_id={CONSUMER_KEY}&%0Aredirect_uri=https://login.salesforce.com/services/oauth2/success&%0Aresponse_type=code' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    
    • Auth Code will be returned, make sure to url decode it
  2. Get Access/Refresh Token and Instance URL: Using postman you can hit the API(POST) with:

    curl --location --request POST 'https://login.salesforce.com/services/oauth2/token' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'grant_type=authorization_code' \
    --data-urlencode 'code={AUTH_CODE}' \
    --data-urlencode 'client_id=3MVG95nWQGdmAiErsLECMKGdk.VwGEFICRxttN5I4frUvVqN9LZcxHofqvfhP4CzxVpr9dx5hUdqcuS4MDDxS' \
    --data-urlencode 'client_secret=2273A462B29F20FB8DDDA770C2EAB879DA7F97059A2079C5BA0EA17124DE3514' \
    --data-urlencode 'redirect_uri=https://login.salesforce.com/services/oauth2/success'
    

Authentication

  1. Copy .env.example to .env
  2. Fill in the variables you got from the previous step

After following the above steps, you should be able to now invoke the integration to start collecting data.