向 Microsoft Graph 发出请求时出现身份验证错误 API

AuthenticatonError when making requests to Microsoft's Graph API

我正在尝试查询图表 API 以获取有关用户日历的信息。我目前可以毫无问题地查询 /me:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
    "id": "---",
    "businessPhones": [
        "123456789"
    ],
    "displayName": "john smith",
    "givenName": "john",
    "jobTitle": null,
    "mail": null,
    "mobilePhone": "+123456789",
    "officeLocation": null,
    "preferredLanguage": "en-US",
    "surname": "",
    "userPrincipalName": "person@org.onmicrosoft.com"
}

然而,查询任何资源(即:https://graph.microsoft.com/v1.0/me/calendars)给出错误:

{
    "error": {
        "code": "AuthenticatonError",
        "message": "Error authenticating with resource",
        "innerError": {
            "request-id": "de91f00f-fd39-44cc-8856-757dc4a5ee24",
            "date": "2016-07-22T14:11:04"
        }
    }
}

我一直在谷歌搜索,似乎没有人遇到过这个问题。我的应用程序已正确注册并启用了所有权限。我正在使用 ADAL 通过 Angular 调用 API。该应用程序获取令牌并进行身份验证没有问题(userInfo 中的isAuthenticated: true)有没有其他人遇到过这个问题?

最终通过放弃图形 api 和查询 https://outlook.office365.com/api/v1.0/me/calendars. The docs at https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations?f=255&MSPPError=-2147217396#GetCalendarView 似乎具有不正确的 api 端点来解决此问题。

我们app的Angular版本是1.2,adal.js的版本是1.0.7。 我没有使用 Azure AD,而是使用注册 @ dev.outlook.