Create an Authenticated Server-to-Server Connection
To set up a server-to-server web connection, create an external client app, add the connector in Data 360, and create a data stream for the data. Use a server-to-server connector when your server already collects engagement data that you want to forward to Data 360 or when you require an authenticated connection to Data 360.
To configure OAuth for the external client app you will use in your server-to-server connection, create a private/public RSA key pair and a digital x509 certificate.
Important: If you already have an external client app that you want to use, ensure that you have the private/public RSA key pair you used to create the x509 certificate for that app, as you need them to enable OAuth in a subsequent step.
- From your terminal, change directories to any folder.
- Create the private/public key pair.
- Create a digital certificate from the key pair.
- Complete the questions as prompted.
- Create a pkcs8 private key from the key pair.
- Keep the private/public key pair and the digital x509 certificate, as you need them in the following task.
You must configure an external client app to send data into Data 360 using a server-to-server connection.
- In the Setup’s Quick Find, search for "External Client App Manager".
- Select New External Client App and set the required basic information values.
- Select Enable OAuth under the API (Enable OAuth Settings) dropdown.
- Enter the callback URL (endpoint) that Salesforce calls back to your application during OAuth. It’s the same as the OAuth redirect URI.
- Set these OAuth scopes:
- Manage user data via APIs (api)
- Perform requests at any time (refresh_token, offline_access)
- Manage Data 360 Ingestion API data (cdp_ingest_api)
- To use JWT OAuth Flow, select Enable JWT Bearer Flow under Flow Enablement.
- Click Choose File, and select the certificate (.crt file) you created in Create a Private/Public Key Pair and Certificate.
- Clear the selection for Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows.
- Click Create.
- On the Policies page, click Edit.
- Change Permitted Users policies to All users may self-authorize.
- Change IP Relaxation to Relax IP restrictions.
- Click Save.
- Under the Settings menu, open the OAuth Settings dropdown and note the Callback URL set on creation and Consumer Key by following the link.
Using the Consumer Key and Callback URL created in Enable OAuth settings for the API integration, paste the following URL into your browser using the noted values:
You can create a secure server-to-server connection between your website source and Data 360 to programmatically capture and ingest data.
-
In Salesforce, go to Setup, and then select Data Cloud Setup.
-
Click Web & Mobile SDK, and then click New.
-
Enter the app name, and for connector type, select Server to Server. If needed, you can later edit the app name.
-
To select a JSON Event Type schema file from your computer, in the Schema section, click Upload Files.
-
Preview the schema and verify your Event Category, Field data types, Primary Key, and whether a field is marked as required.
-
Confirm that all events and fields are populated accordingly and save your work.
-
After your schema is uploaded, compare it with your JSON schema file for accuracy.
- To change your schema at any point, click Update Schema. You can only add events or fields; the schema must retain all previous events and fields
- To update your schema, click Yes, Update or to view the full schema you uploaded, click View Full Schema.
-
In the integration section, copy the system-generated Source ID. You need this to make server-to-server requests as the
{appSourceId}.
Create a data stream to begin the flow of engagement and profile data in real time from your server to Data 360. Data streams refresh engagement data every 15 minutes and profile data every hour from the data stream.
-
In Data Cloud, navigate to the Data Streams tab.
-
Click New.
-
Select Server to Server.
If you don’t see the data source that you want, confirm that your Data Cloud architect uploaded the JSON schema for that application.
-
Click Next.
-
Select the events to include in the data stream and click Next. The events are pulled from the JSON schema uploaded in Setup.
-
Review the list of selected events, their associated fields, and how the data source objects are mapped to the data model objects.
-
Click Next.
A separate data stream is created for each event with category = "Profile". A single data stream is created for all events with category = "Engagement".
-
If you have more than one data space, select the data space for this data stream using the Data Space dropdown menu.
-
To create the data stream, click Deploy.