ADO.NET Provider for Dynamics CRM

Build 21.0.8137

Establishing a Connection

Connecting to Dynamics CRM

To connect, set Url to the root URL of your organization and set User, Password, and CRMVersion.

Authenticating to CRM On-Premises

Additionally for CRM on-premises, select an authentication method. By default, the provider uses Windows (NTLM) authentication. To use another authentication type, such as Kerberos delegation, set AuthScheme. The following is an example connection string:

AuthScheme=Auto;Url=https://myOrg.crm.dynamics.com/;User=username;Password=password;CRM Version='CRM2011+'"

Authenticating to CRM Internet Facing Deployments

For Dynamics CRM with IFD, set InternetFacingDeployment to true. The following is an example connection string:

AuthScheme=Auto;Url=https://myOrg.crm.dynamics.com/;User=username;Password=password;InternetFacingDeployment=True;CRM Version='CRM2011+'"

Authenticating with OAuth

Dynamics CRM supports the OAuth 2.0 authentication standard. To authenticate using OAuth, you may create a custom app to obtain the OAuthClientId, OAuthClientSecret to use custom OAuth credentials. In addition to those properties, set CallbackURL. See Using OAuth Authentication for more information.

You should set the AuthScheme to OAuth to enforce the OAuth Authentication scheme.

After creating your OAuth Application, set the following connection properties:

  • AuthScheme: Set to OAuth.
  • OAuthClientId: Set to the consumer key in your app settings.
  • OAuthClientSecret(optional): Set to the consumer secret in your app settings.
  • ADFSServer: Set to the adfs server in your deployment.

When you connect, the provider opens the OAuth endpoint in your default browser. Log in and grant permissions to the application. The provider then completes the following OAuth process:

  1. Gets the callback URL and sets the access token and ADFSServer to authenticate requests.
  2. Saves OAuth values in your connection settings to be persisted across connections.
  3. Exchanges the returned refresh token for a new, valid access token.
The following is an example connection string for Internet Facing Deployments:
AuthScheme=OAuth;Url=https://myOrg.crm.dynamics.com/;CRM Version=CRM2011+;InitiateOAuth=GETANDREFRESH;CallbackUrl=http://localhost:33333;OAuthClientId=ClientID;ADFSServer=https://auth.adfs.com/;"
The following is an example connection string for Online Instance:
AuthScheme=OAuth;Url=https://myOrg.crm.dynamics.com/;CRM Version=CRMOnline;InitiateOAuth=GETANDREFRESH;CallbackUrl=http://localhost:33333;OAuthClientId=ClientID;AzureTenant=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;"

Authenticating with Kerberos

Please see Using Kerberos for details on how to authenticate with Kerberos

Copyright (c) 2022 CData Software, Inc. - All rights reserved.
Build 21.0.8137