|
1 | 1 | - A Salesforce account. [Create an account](https://developer.salesforce.com/signup). |
| 2 | +- Your Salesforce username. |
| 3 | +- The Salesforce categories (objects) that you want to access, specified as a comma-separated list. Available categories include `Account`, `Campaign`, `Case`, `EmailMessage`, and `Lead`. |
| 4 | +- The OAuth consumer key (client ID) for the target Salesforce connected app in the account. |
| 5 | +- The contents of the private key (PEM) for the certificate that is associated for the Salesforce connected app. The PEM must be expressed as a |
| 6 | + single-line string without line breaks. To print this single-line string without line breaks, suitable for copying, |
| 7 | + you can run one of the following commands from your Terminal or Command Prompt. In this command, replace |
| 8 | + `<path-to-private-key-file>` with the path to the `.pem` file. |
2 | 9 |
|
3 | | - <iframe |
4 | | - width="560" |
5 | | - height="315" |
6 | | - src="https://www.youtube.com/embed/PIVPq2J1OMA" |
7 | | - title="YouTube video player" |
8 | | - frameborder="0" |
9 | | - allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" |
10 | | - allowfullscreen |
11 | | - ></iframe> |
12 | | - |
13 | | -- The Salesforce categories (objects) that you want to access, specified as a comma-separated list. Available categories include `Account`, `Case`, `Campaign`, `EmailMessage`, and `Lead`. |
14 | | -- The OAuth consumer key (client ID) and private key (PEM) for the Salesforce connected app. The PEM is a string that begins with `—–BEGIN RSA PRIVATE KEY—–` and ends with `—–END RSA PRIVATE KEY—–`. [Create a connected app](https://help.salesforce.com/s/articleView?id=sf.connected_app_create.htm&type=5). [Get the consumer key](https://help.salesforce.com/s/articleView?id=sf.connected_app_rotate_consumer_details.htm&type=5). [Get the private key](https://help.salesforce.com/s/articleView?id=sf.task_create_a_certificate_and_private_key.htm&type=5). |
15 | | - |
16 | | - <iframe |
17 | | - width="560" |
18 | | - height="315" |
19 | | - src="https://www.youtube.com/embed/GcbcMsMV4oY" |
20 | | - title="YouTube video player" |
21 | | - frameborder="0" |
22 | | - allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" |
23 | | - allowfullscreen |
24 | | - ></iframe> |
25 | | - |
26 | | - <iframe |
27 | | - width="560" |
28 | | - height="315" |
29 | | - src="https://www.youtube.com/embed/hFV2Ao4aXAY" |
30 | | - title="YouTube video player" |
31 | | - frameborder="0" |
32 | | - allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" |
33 | | - allowfullscreen |
34 | | - ></iframe> |
35 | | - |
| 10 | + For macOS or Linux: |
| 11 | + |
| 12 | + ```bash |
| 13 | + awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' <path-to-private-key-file> |
| 14 | + ``` |
| 15 | + |
| 16 | + For Windows: |
| 17 | + |
| 18 | + ```bash |
| 19 | + (Get-Content -Path "<path-to-private-key-file>" -Raw).Replace("`r`n", "\n") |
| 20 | + ``` |
| 21 | + |
| 22 | +To get your Salesforce username, do the following: |
| 23 | + |
| 24 | +1. Log in to your Salesforce account. |
| 25 | +2. In the top navigation bar, click the **Quick Settings** (gear) icon, and then click **Open Advanced Setup**. |
| 26 | +3. In the search box, search for and go to **Users**. |
| 27 | +4. Note the **Name** value (_not_ the **User Name** value) for your user. |
| 28 | + |
| 29 | +If you do not already have a Salesforce connected app, to create one, start by creating or getting the certificate (`.crt`) and private key (`.pem`) files |
| 30 | +that you will associate with the connected app. If you do not have the certificate and private key, you can use your local machine to create your own |
| 31 | +private key and self-signed certificate, if your organization allows, by running the following commands, one command at a time: |
| 32 | + |
| 33 | +```bash |
| 34 | +openssl genrsa -out MyPrivateKey.pem -traditional |
| 35 | +openssl req -new -key MyPrivateKey.pem -out MyCertificateSigningRequest.csr |
| 36 | +openssl x509 -req -in MyCertificateSigningRequest.csr -signkey MyPrivateKey.pem -out MyCertificate.crt -days 365 |
| 37 | +``` |
| 38 | + |
| 39 | +Be sure to store these generated files in a secure location. |
| 40 | + |
| 41 | +To create a Salesforce connected app, do the following: |
| 42 | + |
| 43 | +1. Log in to your Salesforce account. |
| 44 | +2. In the top navigation bar, click the **Quick Settings** (gear) icon, and then click **Open Advanced Setup**. |
| 45 | +3. In the search box, search for and go to **App Manager**. |
| 46 | +4. Click **New Connected App**. |
| 47 | +5. With **Create a Connected App** selected, click **Continue**. |
| 48 | +6. At a minimum, fill in the following, and then click **Save**: |
| 49 | + |
| 50 | + - **Connected App Name** |
| 51 | + - **API Name** (can be same as **Connected App Name**, but do not use spaces or punctuation) |
| 52 | + - **Contact Email** |
| 53 | + - Check **Enable OAuth Settings**. |
| 54 | + - For **Callback URL**, entering `http://localhost` is okay if you won't be using this connected app for other special authentication scenarios. |
| 55 | + - Check **Use Digital Signatures**. Click **Choose File**, and browse to and select your certificate (`.crt`) file. |
| 56 | + - For **Selected OAuth Scopes**, add **Manage user data via APIs (api)** (recommended) or **Full access (full)**. |
| 57 | + |
| 58 | +To get the Salesforce connected app's consumer key, do the following: |
36 | 59 |
|
| 60 | +1. Log in to your Salesforce account. |
| 61 | +2. In the top navigation bar, click the **Quick Settings** (gear) icon, and then click **Open Advanced Setup**. |
| 62 | +3. In the search box, search for and go to **App Manager**. |
| 63 | +4. In the list of apps, click the arrow next to the target connected app, and click **View**. |
| 64 | +5. Click **Manage Consumer Details**. |
| 65 | +6. Complete the on-screen security verification. |
| 66 | +7. Note the **Consumer Key** value. |
37 | 67 |
|
0 commit comments