CRM Integration - Configuring Dynamics 365 On Premises

This guide has been tested with Dynamics 365 See Microsoft Updates for latest Cumulative Updates and Version Numbers.


  • Microsoft Dynamics 365
  • Dynamics configured for Claims Based Authentication with ADFS3.0 or ADFS4.0*
  • Dynamics configured for Internet Facing Deployment (IFD) 
  • Public Accessible ADFS 4.0 Server configured with oauth2

Microsoft Supported Environments

*Microsoft do not officially support ADFS4.0 and dynamics 365. However, ADFS3.0 does not fully implement the complete OAuth2 protocol. An ADFS 4.0 (or other compatible OAuth2 Authorization server) must run to provide the interaction with the VIA portal.

The ADFS 4.0 server is used for the interaction between the VIA portal and your organisation for initial authorization. No IFD configuration changes on the Dynamics CRM instance are needed - this is still configured to use ADFS3.0.

ADFS4.0 can be be run along side ADFS3.0 as a separate ADFS forest - it will just have different public url, for example https://sts4.[]/adfs/oauth2/authorize.

Other OAuth Authentication servers may be supported instead of ADFS4.0 - the requirement is that there is support for token response type, not just code response type.


Step One

Ensure ADFS is installed and configured correctly with public certifications and public access.

Step Two

Configure Dynamics 365 for IFD.

Step Three

Required Parameters:

  • [GUID] - Unique Guid generated by you
  • [AUTH_URL] -Server Role URL - the External Internet Facing Server Location setup in the CRM IFD wizard - eg https://auth.[]/

Create a client application in ADFS from PowerShell using these two ADFS cmdlets:

Add-AdfsClient -Name "VIA Portal CRM" -ClientId "[GUID]" -RedirectUri "" -Description "VIA Portal CRM"

Grant-AdfsApplicationPermission -ClientRoleIdentifier "[GUID]" -ServerRoleIdentifier "[AUTH_URL]"

Step Four

Required Parameters:

  • [GUID] - Unique GUID generated by you
  • https://[] - The URL of your CRM instance
  • https://sts4.[]/adfs/oauth2/authorize - The Oauth2 endpoint of your ADFS4.0 Environment

Connect VIA Portal to your CRM instance:

  1. In Via Contact Centre goto the CRM Integration window in the VIA portal.
  2. Enter the [GUID] in the Client ID field
  3. Enter the URL of your dynamics instance in the Endpoint URL field eg https://[]
  4. Enter your Oath Endpoint Application URL into the Application URL field of your ADFS 4.0 server eg - https://sts4.[]/adfs/oauth2/authorize
  5. Click sign in and then enter your Dynamics CRM credentials

Step Five

Configure VIA Portal to search for the required CRM entities:

  1. You can now add the Search Objects that you want to search against and also what fields to return from Dynamics CRM when performing the search lookup in the Agent Dashboard
  2. Click Add Search Object
  3. The VIA Portal will then load from Dynamics CRM all of your available entities
  4. Choose the relevant entity from the Entity dropdown
  5. Select the fields you want to search and what you want to appear
  6. Click Save
  7. Repeat steps 6 - 10 for each entity you want to add
  8. Click Save Changes when you are finished
  9. You have now configured the VIA Portal to integrate with Dynamics CRM
  10. Agents logged into the Agent Dashboard will now be able to see CRM records when they receive calls through the contact centre


You can test CRM API access with ADFS and oAuth2 by using postman:

First remove the ADFS client with:

Remove-ADFSClient -TargetClientId [GUID]

Add the client again, but with an additional postback specified:

Add-AdfsClient -Name "Postman App" -ClientId "[GUID]" -RedirectUri @("https://callbackurl", "") -Description "PostmanApp"

Re run the grant permissions
Grant-AdfsApplicationPermission -ClientRoleIdentifier "[GUID]" -ServerRoleIdentifier ""


Use the following environment setup:

url https://[add your CRM url name, like ‘https://crm.myorg.crm’].
clientid [GUID]
version 8.2
webapiurl {{url}}/api/data/v{{version}}/
callback https://callbackurl
authurl https://[YOUR ADFS servers eg. STS.YourDomain.Com]/adfs/oauth2/authorize?resource={{url}}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request