Skip to main content

Configure inbound authentication

This section describes how to authorize AppDirect to connect to Salesforce APIs.

Prerequisites

  1. Create a dedicated integration user in Salesforce. For more information, see Create an integration user in Salesforce.
  2. Generate a security token for the integration user.

    Caution Resetting the security token revokes previously issued tokens and will break any integrations that are configured to use them. If you are using an existing integration user instead of creating a new one dedicated to theAppDirect integration, do not perform the following steps. Reference the existing token.

  3. Log in to Salesforce as the integration user.
  4. Click the profile icon and then select Settings.
  5. From the My Personal Information menu, select Reset My Security Token and then click Reset Security Token.
  6. Copy the security token for the webhook setup.

Prerequisites for scratch organizations

  1. Identify a Salesforce instance URL. For more information, see View instance information for your Salesforce organization.
  2. Log in to Salesforce and copy the URL in the browser. It could be in one of the following two formats:
    1. https://business-force-7164-dev-ed.lightning.force.com/
    2. https://business-force-7164-dev-ed.my.salesforce.com/
  3. Click the gear icon and then select Setup.
  4. Go to Settings > Company Settings > Company Information.
  5. In the Instance field, note the web instance. For example, CS95.
    If your URL is https://business-force-7164-dev-ed.my.salesforce.com/ and the instance is CS95, your instance URL is https://business-force-7164-dev-ed.cs95.my.salesforce.com/.
  6. Save your instance URL (the server the Salesforce scratch organization is running on) for your webhook access token URL.

Configure create a new authentication provider in Salesforce

note

While the following authentication configurations are packable, do not include them in the AppDirect managed package.

Each installation is configured as follows:

  • Connected applications are defined in each Salesforce organization. Each connected application has a unique consumer key and secret.
  • An integration user is specific to the Salesforce organization.
  1. In Salesforce, click the gear icon and then select Setup.
  2. Go to Platform Tools > Apps > App Manager.
  3. Click New Connected App.
  4. Add the following values to the New Connected App dialog:
    FieldValue
    Connected App NameAppDirect Inbound Auth
    API NameAppDirect_Inbound_Auth
    Contact Email<Salesforce admin user or support department email>
    Contact Phone<Salesforce admin user or support department phone>
    DescriptionAuthentication for AppDirect webhook integration.
    Enable OAuth Settingsenable
    Enabling this field adds more fields (listed below) to the dialog.
    Enable for Device Flowdisable
    Callback URLProduction Org: https://login.salesforce.com/services/oauth2/callback
    Sandbox Og: https://test.salesforce.com/services/oauth2/callback
    Use digital signaturesdisable
    Selected OAuth ScopesAccess and manage your data (api)
    Perform requests on behalf at any time (refresh_token, offline access)
    Require Secret for Web Server Flowenable
    Require Secret for Refresh Token Flowenable
    Introspect All Tokensdisable
    Configure ID Tokendisable
    Enable Asset Tokensdisable
    Enable Single Logoutdisable
  5. Click Save.
  6. Copy the consumer key and secret. You will need both to configure the webhooks in AppDirect.

Create a new webhook in AppDirect

  1. In AppDirect, go to Manage > Marketplace > Settings > Integrations | Webhooks.
  2. Click Add Webhook.
  3. Add the following values to the Add Webhook dialog:
    FieldValue
    URLScratch Org:
    https://<domain>.<instance>.my.salesforce.com/services/apexrest/webhook
    Partner Developer Edition Org: https://<domain>.my.salesforce.com/services/apexrest/webhook
    Installed Package (add namespace to path): https://<domain>.my.salesforce.com/services/apexrest/AppDirect/webhook
    Events
    ResourceCOMPANY, PRODUCTS, LEADS
    ActionsCOMPANY - COMPANY/ADDED, COMPANY/CHANGED
    PRODUCTS - PRODUCTS/ADDED, PRODUCTS/CHANGED, PRODUCT/DELETED
    LEADS - LEADS/ADDED, LEADS/CHANGED, LEADS/DELETED
    Auth TypeOAuth2 (Resource Owner Password)
    Access Token URIScratch org: https://<domain>.<instance>.my.salesforce.com/services/oauth2/token
    Partner Developer Edition Org: https://<domain>.my.salesforce.com/services/oauth2/token
    Client ID(client ID created in the connected app setup)
    Client Secret(client secret created in connected app setup)
    UsernameSalesforce integration user name
    PasswordSalesforce integration user password + security token. For example, if the password is "123" and the security token is "ABC", then enter 123ABC.

Validate the connection

Validate the inbound authentication by creating data in AppDirect

  1. From Salesforce, click the gear icon and then click Setup.
  2. Go to Platform Tools | Environments > Logs > Debug Logs.
  3. From the User Trace Flags table, click New.
  4. Enter the following values in the New Trace Flag dialog.
    FieldValue
    Traced Entity TypeUser
    Traced Entity NameSearch for corresponding user. Webhooks will run as an integration user.
    Start DateNow
    Expiration DateWhenever you expect to finish validation testing. For example, an hour from now.
    Debug levelSearch for SFDC_DevConsole, or configure a new debug level if you would like a more granular view.
  5. Click Save.
  6. Test the webhook resource/action in the corresponding AppDirect marketplace. For example, if you are testing a company, edit a company in the marketplace.
  7. Refresh the debug log in Salesforce to view the results.

What's next?

Configure single sign-on

References

Was this page helpful?