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

前端 未结 4 1282
情书的邮戳
情书的邮戳 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 20:51

    The azure version of the translator has changed things once more- the Oauth token request uses a new url and only needs your secret key, instead of all the other baggage. This page discusses it (but using PHP code): http://www.bradymoritz.com/php-code-for-bingmicrosoftazure-translator/

    The key items are:

    1. Post an empty request to https://api.cognitive.microsoft.com/sts/v1.0/issueToken
    2. Pass it your secret key using the header "Ocp-Apim-Subscription-Key: "
    3. Or, just use the querystring parameter: "Subscription-Key="

    Then get the body of the return as the actual token- it's the whole body, not in json format.

    This is a lot simpler than the method used before, but it'd definitely a pain that things have yet again changed.

提交回复
热议问题