Azure AD B2C - Microsoft Graph API - Authorization_IdentityNotFound

Azure AD B2C - Microsoft Graph API - Authorization_IdentityNotFound

我已成功设置 Azure B2C,人们可以登录等。 现在我想以编程方式访问 Azure AD。因此,我在我的 Azure AD B2C 租户中创建了一个新的应用程序注册,授予了所有可能的权限,并授予了管理员同意。基本上遵循概述的所有步骤 here

我可以成功检索访问令牌,但是一旦我调用图形 API,我就会收到此错误:

{
    "error": {
        "code": "Authorization_IdentityNotFound",
        "message": "The identity of the calling application could not be established.",
        "innerError": {
            "request-id": "7d96b137-c45c-4440-a14f-51227b9fa379",
            "date": "2017-09-21T08:24:56"
        }
    }
}

其他帖子表明权限错误(我已经为 MS Active Directory 和 Microsoft Graph 提供了所有可能的权限),和/或未同意。

奇怪的是,如果我调用 /users/.../drive/root/children 我会得到一个不同的错误,表明它可以找到我的租户:

{
    "error": {
        "code": "BadRequest",
        "message": "Tenant does not have a SPO license.",
        "innerError": {
            "request-id": "9018c1d1-f3a9-421d-9c9d-011ff710ed53",
            "date": "2017-09-21T08:30:11"
        }
    }
}

从 Azure AD Graph 切换到 Microsoft Graph 后,很难进行调试。

您不能使用使用 Azure AD Graph API 的 . Follow this guide