Install and Configure b+s Partner Messaging for Webex Connect
Install the package
- Install the
b+s Partner Messaging for Webex Connectpackage from AppExchange or using the direct link, if provided.
Salesforce Org pre-setup
Create Presence Statuses
Create a Routing Configuration
- From Setup, in the Quick Find box, enter
Routing Configurations - Click on
Newbutton - Specify the
Routing Configuration NameandDeveloper Name - Set the
Routing Priority,Routing ModelandCapacity Typeaccording to needs - Set a value in either
Units of CapacityorPercentage of Capacity - Save
Create a Queue
- From Setup, in the Quick Find box, enter
Queue - Click on
Newbutton - Specify a
LabelandQueue Name - In
Routing Configurationfind and set the Routing Configuration record just created - Under
Supported ObjectsfindMessaging Sessionand move it to theSelected Objectsbox
Do not add other objects than Messaging Session in the Selected Objects box
- Under
Queue Membersadd the required Agents - Save
Use Enhanced Conversation chat component in MessagingSession page
- Open
Setup > Object Manager - Find and click on
Messaging Sessionobject - Click on
Lightning Record Pages - Edit the existing page or create a new one if none is available
- If a new page is being created, select
Record Pageas type, provide aLabeland selectMessaging Sessionas object, the click onClone Salesforce Default Pagetab. - In the Page Editor, remove the
Conversationcomponent from theConversationtab and replace it with theEnhanced Conversationcomponent available from the components list. - To prevent showing to agents the customer’s previous messaging sessions in the Conversation component, check the
Limit conversation historycheckbox in theEnhanced Conversationcomponent settings panel on the right side of the screen. - Save and Activate the Lightning page
Set Up and Configure the OAuth Connected Apps
To establish communication between Webex Connect and Salesforce, two Connected Apps are required:
- Webex Connect Connected App: Used to authenticate requests sent from a Webex Connect Flow to Salesforce. This app issues an access token with permission to use the b+s REST Service.
- Salesforce Interaction Service API Connected App: Used by Salesforce to authenticate calls to the Interaction Service API.
When a request is sent from a Webex Connect Flow:
- It first uses the Webex Connect Connected App to obtain an access token.
- The Run As User defined in this Connected App is then used by Salesforce APEX to log in to the Salesforce Interaction Service API Connected App.
- Finally, the request is forwarded to the Salesforce Interaction Service API.
Create a Connected App to allow connections from Webex Connect
To enable mutual TLS (mTLS) for requests sent from Webex Connect to the b+s Salesforce REST Service, you first need to request Mutual Authentication activation for your Salesforce org and set Up a Mutual Authentication Certificate. After completing these steps, ensure that all requests sent from Webex Connect are signed using a certificate stored in the Mutual Authentication Certificate store within your Salesforce org.
- Create a Connected App, fill in the basic required information (ref)
- Select the
Enable OAuth Settingscheckbox, and configure these settings:- Set the callback URL as
https://salesforce.com - Add the OAuth scope:
Manage user data via APISs (api) - Select
Enable Client Credentials Flowand confirm the promt message by pressing theOKbutton. - Save your changes, then click Continue
- Set the callback URL as
- Click on
Managebutton - Click
Edit Policies - In the
Client Credentials Flowsection, set aRun Asuser. This user must have the required permissions to execute the Apex classes provided by the b+s Partner Messaging for Webex Connect package. - Save your changes
Get Consumer Key and Consumer Secret
To be able to use the Connected App from your Webex Connect Flow, the Consumer Key and Consumer Secret must be configured in your Flow.
- Open the Connected App previously created in view mode
- Click
Manage Consumer Details, Verify your identity with the Verification Code. - Make a note of the
Consumer Keyand theConsumer Secretfor later use.
Create a Connected App to authenticate to the Salesforce Interaction Service API
The Connected App required to authenticate against the Salesforce Interaction Service API requires a Certificate. The Certificate has to be attached to the Salesforce Interaction Service API Connected App, the private key of the certificate can be stored in Salesforce Certificate and Key Management or in custom meta data. You can use an existing valid certificate or create a new one by following the instructions below.
Using the Certificate and Key Management section of your Salesforce's Org Setup
Supported certificates:
- Create a new Self-Signed Certificate
- Create a new CA-Signed Certificate
- Import an existing Certificate from Keystore
To create certificates in Salesforce, follow the official docs.
Download the certificate and make a note of its Unique Name, both will be used in a later stage of the package configuration.
Using OpenSSL
Skip this chapter if you use Salesforce Certificate and Key Management
Follow the instructions in Salesforce official documentation
This process produces two files:
server.key: The private key (will be required later in the configuration)server.crt: The digital certificate, it must be uploaded during the creation of the Connected App (next step)
Store these two files in a safe place. Make a note of the private key of the Certificate (content of server.key), it will be required to complete the configuration in a later step.
Salesforce Interaction Service API Connected App
- Create a Connected App, fill in the basic required information (ref)
- Select the
Enable OAuth Settingscheckbox, and configure these settings:- Set the callback URL as
https://salesforce.com - Select
Use digital signatures, then click Choose File and select the certificate previously created or imported in the keystore. - Add the OAuth scopes:
Access Interaction API resources(interaction_api) andPerform Requests at any time(refresh_token, offline_access) - Save your changes, then click Continue
- Set the callback URL as
Manage Access to Your Connected App for OAuth
- Open the Connected App created in the previous step in Manage Mode
- Click
Edit Policies - In the
OAuth Policiessection, setPermitted UserstoAdmin approved users are pre-authorized. If you see a warning message, click OK - Save your changes
- Under
Profilessection, click onManage Profilesbutton - Select the profile of the
Run AsUser configured in the Connected App for the connection from Webex - Save your changes
Grant access to Interaction Service API Connected App to the Automated Process User
- Open
Setup>Permission Sets>New - Fill in the mandatory fields, then click
Save - Make a note of the
API Name, it will be needed in the next step - Click on
Assigned Connected Apps>Edit - Move the Interaction Service API Connected App just created from
Installed Connected AppstoEnabled Connected Apps(box on the right) - Click
Save
Run APEX script to assign the permission set to the Automated Process User
- Open the Developer Console (ref)
- Click on
Debug>Open Execute Anonymous Window - In the
Enter Apex Codetextarea, paste the following apex code:
PermissionSet permSet = [SELECT id FROM PermissionSet WHERE name = 'INSERT_HERE_PERMISSION_SET_API_NAME'];
User autoProcessUser = [SELECT Id FROM User WHERE alias = 'autoproc'];
PermissionSetAssignment permSetAssignment = new PermissionSetAssignment(
AssigneeId = autoProcessUser.Id,
PermissionSetId = permSet.Id
);
insert permSetAssignment;
- Make sure to replace
INSERT_HERE_PERMISSION_SET_API_NAMEwith the API Name of the permission set created in the previous step - Click
Execute - If no error are returned, the permission set has been successfully assigned to the Automated Process User