Hi Team,
Please find find below is the connection string format where OAuth not working.
public static CrmServiceClient Connection()
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
//ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
string authType = "OAuth";
string userName = "abcd@d365.onmicrosoft.com";
string password = "12345";
string url = "">abcd.crm8.dynamics.com";
string appId = "51f81489-12ee-4a9e-aaae-a2591f45987d";
string reDirectURI = "app://58145B91-0C36-4500-8554-080854F2AC97";
string loginPrompt = "Never";
string ConnectionString = string.Format("AuthType ={0};Username ={1};Password ={2};Url ={3};AppId={4};RedirectUri={5};LoginPrompt={6}",
authType, userName, password, url, appId, reDirectURI, loginPrompt);
CrmServiceClient svc = new CrmServiceClient(ConnectionString);
return svc;
}
I have tried below web.config option also :
<appSettings>
<add key="CRMConnectionString" value="AuthType=OAuth; Username=abcd@d365.onmicrosoft.com; Password=12345; Url=https://abcd.crm8.dynamics.com; AppId=51f81489-12ee-4a9e-aaae-a2591f45987d; RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97; LoginPrompt=Never"/>
</appSettings>
Problem :- When I trying to call above function is will give below error, I have tried multiple blogs but that didn't work in my case.
Unable to Login to Dynamics CRMOrganizationWebProxyClient is null
OrganizationWebProxyClient is nullOrganizationWebProxyClient is null
OrganizationWebProxyClient is nullOrganizationWebProxyClient is null