我've set up Azure B2C successfully, people can log in etc. Now I want to access Azure AD programmatically. So, I' ve在我的Azure AD B2C租户中创建了一个新的应用注册,授予了所有可能的权限,并授予管理员同意 . 基本上遵循here概述的所有步骤 .
我可以成功检索访问令牌,但是一旦我调用Graph 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,很难进行调试 .
1 回答
你不能使用Microsoft Graph API for B2C yet . Follow this guide使用Azure AD Graph API .