CrmServiceClient Constructor (String, SecureString, String, String, Boolean, OrganizationDetail, UserIdentifier, String, Uri, String, OrganizationWebProxyClient, PromptBehavior)
Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online
Initializes a new instance of the CrmServiceClient using the OAuth protocol to connect to your CRM Online instance in Office 365.
Namespace: Microsoft.Xrm.Tooling.Connector
Assembly: Microsoft.Xrm.Tooling.Connector (in Microsoft.Xrm.Tooling.Connector.dll)
Syntax
public CrmServiceClient(
string crmUserId,
SecureString crmPassword,
string crmRegion,
string orgName,
bool useUniqueInstance,
OrganizationDetail orgDetail,
UserIdentifier user,
string clientId,
Uri redirectUri,
string tokenCachePath,
OrganizationWebProxyClient externalOrgWebProxyClient,
PromptBehavior promptBehavior = PromptBehavior.Auto
)
Public Sub New (
crmUserId As String,
crmPassword As SecureString,
crmRegion As String,
orgName As String,
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.StringUser name for connecting to CRM Online instance in Office 365 using OAuth.
crmPassword
Type: System.Security.SecureStringPassword for connecting to CRM Online instance in Office 365 using OAuth.
crmRegion
Type: System.StringGeographic region of your Office 365 server where CRM Online is deployed. Valid values are NorthAmerica, EMEA, APAC, SouthAmerica, Oceania, JPN, CAN, IND, and NorthAmerica2. If you specify String.Empty, search will be run for servers in all the regions.
orgName
Type: System.StringCRM organization name that you want to connect to.
useUniqueInstance
Type: System.BooleanIndicates 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.OrganizationDetailThis 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.StringThe Client ID assigned when you registered your application in Microsoft Azure Active Directory or Active Directory Federation Services (AD FS).
redirectUri
Type: System.UriThe redirect URI of the application you registered in Microsoft Azure Active Directory or Active Directory Federation Services (AD FS).
tokenCachePath
Type: System.StringThe 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.OrganizationWebProxyClientThe OrganizationWebProxyClient instance to connect to CRM.
promptBehavior
Type: Microsoft.IdentityModel.Clients.ActiveDirectory.PromptBehaviorSpecify 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).
See Also
CrmServiceClient Overload
CrmServiceClient Class
Microsoft.Xrm.Tooling.Connector Namespace
Return to top
Microsoft Dynamics 365
© 2016 Microsoft. All rights reserved. Copyright