On this topic
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
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.
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.