Hello, I am unable to get a CrmServiceClient from my connectionStrings. I need to use an AuthType OAuth to connect to my CRM instance (Online).
Unfortunately i get this error in my debugger :
Name | Value | Type | |
---|---|---|---|
LastCrmError | "Unable to Login to Dynamics CRMOrganizationWebProxyClient is null" | string |
I always have the same error message, here are my different tests with different connectionStrings :
1) Test with microsoft AppID and RedirectURL :
<add name="ConnectionString"
connectionString="
AuthType=OAuth;
Username=XXX@XXX.fr;
Password=fakePW;
Url=XXXXXX.crm4.dynamics.com;
AppId=51f81489-12ee-4a9e-aaae-a2591f45987d;
RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97;
Integrated Security=true;
TokenCacheStorePath=c:\MyTokenCache\msal_cache.data;
LoginPrompt=Auto"/>
2) Test with my org :
<add name="ConnectionString"
connectionString="AuthType=OAuth;
Username=XXX@XXX.fr;
Password=fakePW;
Url=XXXXXX.crm4.dynamics.com/;
AppId=XXXXXXXXXXXX;
RedirectUri=login.microsoftonline.com/.../authorize;
LoginPrompt=Auto"/>
3) multiple others
I have some doubts about my redirect URL. The redirect URL I use in my 2nd test is the URL given to me in the AzureAD App. I see it uses Oauth2, maybe something there ?
Or do you see what I might be doing wrong ? How can I test with valid informations ? From microsoft for example.