无法访问office365 Calendar API

时间:2015-06-29 15:07:56

标签: azure outlook oauth-2.0 office365 outlook-restapi

我想从Ruby应用程序访问Calendar rest API。 我已经创建了azure多租户应用,并对其进行了配置。

我正在尝试获取资源“https://outlook.office365com/”的访问令牌,但我收到错误

var query = context.Teachers.Select(teacher => new 
{
    teacher.Id,
    teacher.Name,
    Students = teacher.Students.Select(student => new
    {
        student.Id,
        student.Name,
    }
}

我找不到此错误的任何描述,也无法理解为什么禁用

以下是我的天蓝色应用权限:

enter image description here

1 个答案:

答案 0 :(得分:0)

这对我来说是个新错误!我们来检查Exchange主体是否被禁用。为此,您需要使用Remote Powershell连接到Azure AD服务。

以下是如何做到的(我假设你在Windows机器上安装了Powershell):

  1. 为Powershell安装Azure AD模块:https://msdn.microsoft.com/en-us/library/azure/jj151815.aspx#bkmk_installmodule
  2. 打开“Windows PowerShell的Windows Azure Active Directory模块”。按照链接文章中“连接到Azure AD”下的步骤进行操作。
  3. 运行以下命令:Get-MsolServicePrincipal -AppPrincipalId 00000002-0000-0ff1-ce00-000000000000
  4. 你应该看到这样的输出:

    ExtensionData         : System.Runtime.Serialization.ExtensionDataObject
    AccountEnabled        : True
    Addresses             : {}
    AppPrincipalId        : 00000002-0000-0ff1-ce00-000000000000
    DisplayName           : Microsoft.Exchange
    ObjectId              : f7d177d5-2071-45a9-b494-9b98cb4d80e3
    ServicePrincipalNames : {00000002-0000-0ff1-ce00-000000000000/outlook.office365
                            .com, 00000002-0000-0ff1-ce00-000000000000/mail.office3
                            65.com,
                            00000002-0000-0ff1-ce00-000000000000/outlook.com,
                            00000002-0000-0ff1-ce00-000000000000/*.outlook.com...}
    TrustedForDelegation  : True
    

    您可以运行命令并发布结果吗?

相关问题