私はダイナミクス365 crmに私のAPIを接続しようとしています。私は郵便配達員とトークンを取得するとアクセスすることができますが、ADALで取得すると、そのリクエストは401が不正に返されます。 私のアプリケーションで郵便受けを持っているトークンをハードコードするとうまく動作します。 私は郵便配達は私にADALnot(refresh_token、token_idなど)郵便料金トークンOauth2と異なるADAL認証トークン
あなたはOAuth 2.0 authorization code flowを使用してトークン取得されている郵便配達で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);