Why does AcquireToken with ClientCredential fail with invalid_client (ACS50012)?

前端 未结 4 1278
情书的邮戳
情书的邮戳 2021-02-14 20:33

Why won\'t my Azure AD application allow an oauth client_credentials grant?

I want to use the Azure Graph API, but first I need an oauth token. To get the token, I am tr

4条回答
  •  鱼传尺愫
    2021-02-14 21:18

    Have a look at this link: https://azure.microsoft.com/en-gb/documentation/articles/resource-manager-net-sdk/

    The latest version of Active Directory Authentication Library does not support AcquireToken method, instead you have to use AcquireTokenAsync method.

    var result = await authenticationContext.AcquireTokenAsync(resource: "https://{domain}.onmicrosoft.com/{site-if applicable}", clientCredential: credential);
    

提交回复
热议问题