Intermittent Oauth2 access_token issues

Satish Kolli 1 Reputation point
2021-09-29T17:34:37.657+00:00

I am trying to get access_token using the following url. I get an access token some times and a lot of requests are failing with the following error. I tired it from a Rest client (Postman) and I am executing the same request and I see mixed results. Any help is greatly appreciated. Thanks!

https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token

{
"error": "unauthorized_client",
"error_description": "AADSTS700016: Application with identifier 'e2843012-xxxx-xxxx-xxxx-xxxxxxxxxxx' was not found in the directory 'Bot Framework'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.\r\nTrace ID: 9378ecca-3bd1-4c4e-b14a-88bb036b0101\r\nCorrelation ID: d93293e4-1027-4dd5-8e76-cccf7513ea88\r\nTimestamp: 2021-09-29 17:30:51Z",
"error_codes": [
700016
],
"timestamp": "2021-09-29 17:30:51Z",
"trace_id": "9378ecca-3bd1-4c4e-b14a-88bb036b0101",
"correlation_id": "d93293e4-1027-4dd5-8e76-cccf7513ea88",
"error_uri": "https://login.microsoftonline.com/error?code=700016"
}

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,468 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jai Verma 461 Reputation points
    2021-09-29T18:20:17.073+00:00

    Essentially, the error means that there is a mismatch between the tenant where your app is registered and where you have stated in either the AppID or the tenant ID.

    Could you confirm if the AppId and Tenant ID remains same, when making token call from Postman?

    0 comments No comments

  2. Satish Kolli 1 Reputation point
    2021-09-29T18:26:20.707+00:00

    I am not passing in a tenant id from the Postman calls. I am only sending grant_type, client_id, client_secret and scope.

    Also, why would it work some times and fails sometimes. From postman, if I click submit few times (same data), I see several failures and some successes.

    136401-image.png

    0 comments No comments