Connecting to Dataverse api in C#

49 views Asked by At

I am trying to learn the dataverse API using C#. I am following the code in this github: https://github.com/microsoft/PowerApps-Samples/blob/master/dataverse/orgsvc/C%23-NETCore/GetStarted/ConsoleApp%20(public)/Program.cs

I changed the login information and the appID to my app registration's client id and added a redirect URL of http://localhost.

The app registration does have API permissions to Dynamics CRM.

However, I still get an error

Original exception: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'

This is my connection string:

static string connectionString = $@"
AuthType = OAuth;
Url = {url};
UserName = {userName};
Password = {password};
AppId = {appId};
RedirectUri = http://localhost;
LoginPrompt=Auto;
RequireNewInstance = True";

I cannot figure out what the issue is. Any help would be greatly appreciated.

0

There are 0 answers