OAuth2 Guide for CRM integration with 3CX
Take the PBX Express
Your PBX, Your Cloud, ready in minutes
Zero Admin
With the new Dashboard
Bulletproof Security
With SSL certs and NGINX
Install on $200 Appliance
Intel MiniPC architecture
New, Intuitive Windows Client
More themes, more UC
More CRM Integrations
Scripting Interface to add your own
Improved Integrated Web Conferencing
iOS and Android apps included
Run On-Premise or in the Cloud
Google, OVH, Windows & Linux

OAuth2 Authentication

OAuth2 Authentication

On this topic

OAuth2 Authentication

Step 1 - Wizard Setup

Step 2 - Design Authentication Form

Step 3 - Search Contact

Step 4 - Create Contact

Step 5 - Journaling

Helpful Reference

Step 1 - Wizard Setup

When you select OAuth2 authentication, the wizard will ask you to fill in the following fields:

  • Auth Endpoint URL
  • Token Endpoint URL
  • Redirect URL
  • Client ID
  • Client Secret
  • Scope

Step 2 - Design Authentication Form

You can change the design for the Authentication Form from OAuth2Configuration.cs. You can also add additional settings you might need such as change how you ask for the username and password, etc.

Step 3 - Search Contact

The class ContactFinder contains the method findContact(string contactNumber) that searches and finds a matching contact. Add the code to analyze the Response Text you are receiving.

Step 4 - Create Contact

The class MySession contains the method createNewContactRecord(string contactNumber) that creates a new contact in your CRM. Add the code to build the contact data that will be sent to the server, and parse the response text to get the ID of the created contact.

Step 5 - Journaling

The class MySession contains the method StoreCallInformation(CallInformation callInformation) that stores the Journaling/Call History/Notes for inbound and outbound calls related to a contact.

Review the generated code and modify if needed.

Helpful Reference

Download and add the Newtonsoft,JSON.dll to your project to read/write JSON text.

Add the references to the DotNetOpenAuth libraries.

To do this, go to Tools > NuGet Package Manager > Manage NuGet Packages for solution.

Go to the Browse tab, and then search for "DotNetOpenAuth". Select the project entry "DotNetOpenAuth by Andrew Arnott", check your project name in the window that will be shown and finally click the "Install" button to install the package. This will remove the errors in the project related to missing references.

You might also be interested in:

<