Hi Community members,
I used the below code block in C# to create a bearer token:
ClientCredential clientCredential = new ClientCredential(AADClientID, AADClientSecretKey);
AuthenticationContext authContext = new AuthenticationContext(AADTenant);
AuthenticationResult result = authContext.AcquireTokenAsync(D365Url, clientCredential).Result;
string authHeader = result.CreateAuthorizationHeader();
Console.WriteLine(authHeader);
Console.ReadLine();
This code was used earlier to create authentication tokens and then this token was used to call odata services like data/GetTermsList using Postman.
Earlier I used to get data but now I am getting status code 401 unauthorized.
I have created the Dynamics 365 Finance VM from Lifecycle Services.
Then I have also created Azure Active Directory Application under Setup on the System Admin module of the Dynamics 365 Finance portal.
Can anyone share if anything has changed in between last 2-3 months?