Hi can anyone give me some suggestion i need to call Dynamic 365 Api through my asp core app, but i found some several tutorial but i can't make it works. Can anyone give me best practices to do that in asp net core. Here is my code below its not highlight any error but when i try to run it it give me this error message Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
public string GetAuthToken() { // TODO Substitute your app registration values that can be obtained after you // register the app in Active Directory on the Microsoft Azure portal. string clientId = ""; // Client ID after app registration string userName = ""; string password = ""; UserCredential cred = new UserCredential(userName, password); // Authenticate the registered application with Azure Active Directory. AuthenticationContext authContext = new AuthenticationContext("login.windows.net/common", false); AuthenticationResult result = authContext.AcquireToken(serviceUri, clientId, cred); return result.AccessToken; }
*This post is locked for comments