At times we want to quickly try out few things (PoC) by writing a console application or running an SSIS package etc., there we can use the sample ClientId and RedirectUri provided by Microsoft, instead of registering the application in Azure AD / creating Application User
- Sample AppId or ClientId = 51f81489-12ee-4a9e-aaae-a2591f45987d
- Sample RedirectUri = app://58145B91-0C36-4500-8554-080854F2AC97
Connection String within a console app à
CDS /CRM Connection Manager of KingswaySoft ->
or use Interactive Login – https://nishantrana.me/2021/07/01/interactive-login-option-in-cds-crm-connection-manager-in-kingswaysoft-dynamics-365-integration-toolkit/
Also check out -Sample Code (Dynamics 365 Web API) https://nishantrana.me/2021/01/06/sample-code-dynamics-365-web-api-organization-service/
Hope it helps..
private void Form1_Load(object sender, EventArgs e)
{
string ConnectionString = "AuthType = OAuth; " +
"Username = [username].onmicrosoft.com; " +
"Password = [password]; " +
"Url = https://[org].crm.dynamics.com/;" +
"AppId=51f81489-12ee-4a9e-aaae-a2591f45987d;" +
"RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97;" +
"LoginPrompt=Auto";
CrmServiceClient svc = new CrmServiceClient(ConnectionString);
if (svc.IsReady)
{
// do the needful
}
}
Hi Nishant
Is there a way for the redirect URI to be configured in Dynamics for other Identity providers like Okta.
So the MSAL with Azure AD works fine for an API which needs to be consumed in PCF.
But we want the API to be protected using say OKTA IDP and redirect back to Dynamics – can the redirect uri be configured to validate other IDP tokens in such case
https://github.com/okta/samples-js-react/issues/214
https://pcf.gallery/react-aad-msal-pcf/
https://taerimhan.com/using-react-aad-msal-to-call-a-secure-api-from-a-pcf-control/
regards
LikeLiked by 1 person
Not sure if that is possible. Haven’t come across anything for that. Let me check.
LikeLiked by 1 person
Hi,
I post here an example of a console application that uses the same connection string: https://gist.github.com/melamriD365/77f718d9a5802d4d087722d9e6a61d0a
LikeLiked by 2 people
Thanks Mehdi for sharing it..
LikeLiked by 1 person