I am trying get access token without auth code, so using below method to get it. but i am facing issue as "the request body must contain the following parameter 'client_secret or client_assertion'"
Can you suggest necessary pointers on this. Running this in console application
.
try
{
// Use the 'Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory' Nuget package for auth.
AuthenticationContext authContext = new AuthenticationContext(authority);
AuthenticationResult authResult = authContext.AcquireTokenAsync(resourceId, clientId, new UserCredential(crmAdminUserName, crmAdminPassword)).Result;
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}