I'm trying to connect my api to dynamics 365 crm. When I get the token with postman I can access, but when I get it with ADAL , the request returns 401 unauthorized. If I hardcode the token got with postman on my app it works fine. I saw that postman returns me info that ADALnot (like refresh_token, token_id)
Get token with ADAL
string resource = "https://******.crm2.dynamics.com/";
string clientId = "**************";
string clientSecret = "************";
string authority = "https://login.microsoftonline.com/*****/oauth2/authorize";
ClientCredential credential = new ClientCredential(clientId, clientSecret);
AuthenticationContext authContext = new AuthenticationContext(authority, true);
AuthenticationResult result = await authContext.AcquireTokenAsync(resource, credential);