Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Since Cloudaware is built on force.com, address Salesforce CLI is a powerful command line interface that simplifies development and build automation when working with your Salesforce account.

Table of Contents

Install Salesforce CLI application

1. Download and install the Salesforce CLI application for you OS : https://developer.salesforce.com/tools/sfdxcliusing this link.


2. Open Terminal and run the command sfdx to make sure the application was successfully installed.[screen]

...

Create a private key and self-signed digital certificate

...

The JWT-based authorization flow requires a digital certificate and the private key used to sign the certificate. You upload the digital certificate to the custom connected app that is also required for JWT-based authorization. This  This process produces two files.:

  • server.key - The private key. You specify this file when you authorize an org with the force:auth:jwt:grantcommandgrant command.

  • server.crt - The digital certification. You upload this file when you create the connected app required by the JWT-based flow.

...

1. If necessary, install OpenSSL on your computer. To check whether OpenSSL is installed on your computer, run this command.1 | : which openssl


2. In Terminal or a Windows command promptCommand Prompt, create a directory to store the generated files, and change to the directory.

1 | mkdir /Users/jdoe/JWT

1 | cd /Users/jdoe/JWT


3. Generate a private key, and store it in a file called server.key.

1 | openssl genrsa -des3 -passout pass:x -out server.pass.key 2048

1 | openssl rsa -passin pass:x -in server.pass.key -out server.key

You can delete the server.pass.key file because you no longer need it.


4. Generate a certificate signing request using the server.key file. Store the certificate signing request in a file called server.csr. Enter information about your company when prompted.

1 | openssl req -new -key server.key -out server.csr


5. Generate a self-signed digital certificate from the server.key and server.csr files. Store the certificate in a file called server.crt.

1 | openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt


Create a connected app in your Salesforce organization account

1. Log in to your Cloudaware organizationaccount.

2. Open the main menu under your username. Go to Setup - → Build: Create - Apps - → section 'Connected Apps - ' → New.Update the basic information as needed, such as the

...

3. Enter a meaningful connected app name and your email address.

Select 4. Check the box Enable OAuth Settings.

5. For the callback Callback URL , enter http://localhost:1717/OauthRedirect

Select 5. Check the box Use digital signatures. Click Choose File and upload the server.crt file that contains your digital certificate.

Add these 6. In the 'Selected OAuth Scopes' section add the following OAuth scopes:

  • Access and manage your data (api)

  • Perform requests on your behalf at any time (refresh_token, offline_access)

  • Provide access to your data via the Web (web)

7. Click Save.

Click Continue

Click Continue Manage.

8. Click Edit Policies. In the 'OAuth Policies' section, select Admin approved users are pre-authorized for Permitted Users, and click OK. Click OK.

9. Click Save.

Authorize a Salesforce org for use with the Salesforce CLI

...