访问图形 API 时出现 Authorization_IdentityNotFound 错误 [英] Authorization_IdentityNotFound Error while accessing graph API

查看:18
本文介绍了访问图形 API 时出现 Authorization_IdentityNotFound 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了我发现的错误,没有找到任何匹配的问题.所以发布问题.欣赏是否有人提供了一些继续进行的指示.

我的目标是在我的桌面客户端中访问图形 API.我已经开始使用 fiddler 进行实验了.

  • 我已按照

    除第 3 步外,所有步骤均已成功完成.Microsoft 代码在项目中成功生成、生成应用 ID 和应用机密,但租户在 appsetting.json 中设置为 common,如下图所示.

    我认为这是一个有效的事情,但后来发现这是导致问题的原因.

    解决方案:我复制了目录(租户)ID,而不是用租户 ID 替换 common,它起作用了.我不确定这是否是 Azure 快速入门代码生成中的错误.

    I have searched with the error which I found, Did not find any matching questions. So posting question. Appreciate if some one provides some pointers to proceed.

    My goal is to access graph API in my desktop client. I have started using fiddler to experiment.

    • I have followed instructions provided at https://graph.microsoft.io/en-us/docs/authorization/app_only
    • registered Web APP using Application Registration portal using my Microsoft work account.
    • Provided 'Read all users' full profiles in Delegated permissions
    • Requested token and Used the token in Authorization header to call the graph API, Getting following error.

      https://graph.microsoft.com/v1.0/users
      119
      {
        "error": {
          "code": "Authorization_IdentityNotFound",
          "message": "The identity of the calling application could not be established.",
          "innerError": {
            "request-id": "4c3a7bc6-e3d8-453c-adc9-5a12fec3b0ee",
            "date": "2016-05-11T00:46:23"
          }
        }
      }
      

    解决方案

    In my case, I got the same error after I used Quickstart (step 1), then configured automatically .net sample (step 2), then download the code sample (step 3) as shown in the picture below.

    All steps was done successfully except step 3. Microsoft code generate, generate app id, and app secret in project successfully but the tenant was set to common in appsetting.json as seen in image below.

    I thought it was a valid thing, but later found out that this caused the issue.

    Solution: I copied the Directory (tenant) ID, than replace common with tenant Id, and it worked. I am not sure if this is a bug in Azure Quickstart code generation.

    这篇关于访问图形 API 时出现 Authorization_IdentityNotFound 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆