CrmServiceClient Constructor (String, SecureString, String, String, String, String, String, Boolean, Boolean, OrganizationDetail, UserIdentifier, String, Uri, String, OrganizationWebProxyClient, PromptBehavior)
Updated: November 29, 2016
Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online
Initializes a new instance of the CrmServiceClient class using the specified network credentials and OAuth protocol.
Assembly: Microsoft.Xrm.Tooling.Connector (in Microsoft.Xrm.Tooling.Connector.dll)
Public Sub New ( crmUserId As String, crmPassword As SecureString, domain As String, homeRealm As String, hostName As String, port As String, orgName As String, useSsl As Boolean, useUniqueInstance As Boolean, orgDetail As OrganizationDetail, user As UserIdentifier, clientId As String, redirectUri As Uri, tokenCachePath As String, externalOrgWebProxyClient As OrganizationWebProxyClient, promptBehavior As PromptBehavior )
Parameters
- crmUserId
-
Type:
System.String
User ID to sign in to CRM.
- crmPassword
-
Type:
System.Security.SecureString
Password to sign in to CRM.
- domain
-
Type:
System.String
Domain name to use for signing in to CRM.
- homeRealm
-
Type:
System.String
Home realm URI of the user.
- hostName
-
Type:
System.String
Name of the server that hosts the Microsoft Dynamics CRM web or discovery service.
- port
-
Type:
System.String
Port number on the server that hosts the Microsoft Dynamics CRM web or discovery service (usually 5555).
- orgName
-
Type:
System.String
CRM organization name that you want to connect to.
- useSsl
-
Type:
System.Boolean
Indicates whether to use SSL to connect to Microsoft Dynamics CRM. Defaults to false, that is, uses http://. If set to true, uses https://.
- useUniqueInstance
-
Type:
System.Boolean
Indicates whether to reuse an existing connection, if recalled while the connection is still active. If set to true, will force the system to create a unique connection.
- orgDetail
-
Type:
Microsoft.Xrm.Sdk.Discovery.OrganizationDetail
This is returned from a query to the Discovery service, and is generally used as the second leg of an organization selection process. You can set it as null if you do not want to specify a value in the request.
- clientId
-
Type:
System.String
The Client ID assigned when you registered your application in Microsoft Azure Active Directory or Active Directory Federation Services (AD FS).
- redirectUri
-
Type:
System.Uri
The redirect URI of the application you registered in Microsoft Azure Active Directory or Active Directory Federation Services (AD FS).
- tokenCachePath
-
Type:
System.String
The full path to the location where the user token cache should be stored. The running process should have access to the specified path.
- externalOrgWebProxyClient
-
Type:
Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClient
The OrganizationWebProxyClient instance to connect to CRM.
- promptBehavior
-
Type:
Microsoft.IdentityModel.Clients.ActiveDirectory.PromptBehavior
Specify whether the user is prompted for credentials if the credentials are not supplied. Valid values are: Always (always prompts the user to specify credentials), Auto (allows the user to select in the login control interface whether to display the prompt or not), or Never (does not prompt the user to specify credentials; if using a connection method does not have a user interface, you should use this value).
Microsoft Dynamics 365
© 2016 Microsoft. All rights reserved. Copyright