For the past week I've been following every video, and tutorial on the web and have not been able to create a successful connection string.
My company has a server established remotely and when i try to connect to our test environment it will not successfully authenticate the string.
Here is the setup:
With all this information I should be able to create the string no problem, but
Whenever I try to make the connection string it won't log on, it'll find the server, but refuses to authenticate any help would be appreciated.
*This post is locked for comments
I have the same question (0)When you say, you are trying to create a connection string, this is in order to develop a custom solution using the SDK?
Since you are using ADFS, you are set to https and IFD (based on the url above):
You connection string should be as follows (inside you app.config):
<connectionStrings>
<add name="Server=company.com, organization=crmtest, user=admin@company.local"
connectionString="Url=server.company.gov/.../Organization.svc; Username=ad\admin; Password=CRM_PASSWORD; authtype=IFD"/>
</connectionStrings>
<appSettings>
<add key="UserName" value="ad\admin"/>
<add key="EncryptedPassword" value="SADWTZWDpPusc4rFx0DT8g==" />
<add key="InternalUrl" value="server.company.com"/>
<add key="OrgName" value="crmtest"/>
</appSettings>
Your application settings above are options since there are multiple ways to connect to environment:
Make sure to add reference to Microsoft.Xrm.Tooling.Connector (in using section)
Connect using Connection String:
connectionString = connectionString.Replace("CRM_PASSWORD", CRM_PASSWORD);
CrmServiceClient conn = new CrmServiceClient(connectionString);
Connect using Application Settings:
string userName = ConfigurationManager.AppSettings["UserName"].ToString();
string internalUrl = ConfigurationManager.AppSettings["InternalUrl"].ToString();
string orgName = ConfigurationManager.AppSettings["OrgName"].ToString();
NetworkCredential creds = new NetworkCredential(userName, ConvertToSecureString(CRM_PASSWORD));
AuthenticationType authType = AuthenticationType.IFD;
CrmServiceClient conn = new CrmServiceClient(creds, authType, internalUrl, "443", orgName, true, true, null);
After the CrmServiceClient has been established, set the Organization Service:
_orgService = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
Hope this helps.
Community Member
2
Christoph Pock
1