The identity of the calling application could not be established

Deeptha 21 Reputation points
2022-03-08T03:10:51.55+00:00

Hey, We are trying to list teams in the Msteams tenant using graph API. But we are getting the below error
result from API of msTeams from try block {
"err": true,
"errMessage": {
"error": {
"code": "Authorization_IdentityNotFound",
"message": "The identity of the calling application could not be established."
}
},
"status": 401
}

What can be the reason for the above error?

Microsoft Security | Microsoft Graph
{count} votes

2 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 46,376 Reputation points
    2022-03-08T09:22:26.437+00:00

    Hi @Deeptha

    I tested it locally and it doesn't seem to have a problem, can you use the Graph Explorer to call the api test?

    180972-image.png

    Also, make sure the user you log into Graph Explorer has an O365 license.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Ramjot Singh 861 Reputation points Microsoft Employee
    2022-03-10T02:38:11.19+00:00

    The reason you are seeing this error is because your app is not provisioned in the target tenant. I am guessing you are calling in application-only context. For this, the admin of the tenant must consent to your application using the following url

    https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=YOURAPPIDHERE&prompt=admin_consent

    Once the consent is granted, a service principal for your application will be provisioned and you should be able to get a token with the right roles and information on it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.