【发布时间】:2015-10-06 13:48:28
【问题描述】:
我有 portal.office.com 帐户,并希望通过我的 REST 应用程序访问 tenant-my.sharepoint.com 上的 OneDrive for business。 我已经在 Azure Active Directory 中注册了我的应用程序并像这样开始 Oauth2 身份验证:
https://login.windows.net/common/oauth2/authorize?response_type=code&client_id='+ App.Key + '&redirect_uri=http://localhost:8889/';
在这个阶段,我从 azure 获得了 AuthCode,下一个阶段是获取会话令牌。
作为身份验证的下一步,我正在向https://login.windows.net/common/oauth2/token 发出 POST 请求 带参数: 'client_id=' + App.Key + 'client_secret=' + App.Secret + 'code=' + 验证码 +'redirect_uri=http://localhost:8889/' +'grant_type=authorization_code' + 'resource='+URLEncode('syncovery1');
很遗憾,我收到错误回复: {"error":"invalid_resource","error_description":"AADSTS50001: 在名为 konnov.onmicrosoft.com 的租户中找不到名为 syncovery1 的应用程序。如果租户管理员未安装该应用程序或租户中的任何用户都同意。你可能已将身份验证请求发送给了错误的租户。\r\n跟踪 ID: 1af2ced2-b2bb-4568-8a87-bd2d1186cf9a\r\n相关 ID: 15dcda2c-0599-4279-8744- 27c61e6912a9\r\n时间戳:2015-10-06 07:46:03Z","error_codes":[50001],"timestamp":"2015-10-06 07:46:03Z","trace_id":"1af2ced2- b2bb-4568-8a87-bd2d1186cf9a","correlation_id":"15dcda2c-0599-4279-8744-27c61e6912a9"}'
请提出可能的解决方案。在我的 portal.office.com 帐户中,我找不到第三方应用程序可能与该帐户相关联的任何地方。你能猜出最后一个请求中“资源”参数的含义吗? portal.office.com 中的哪些服务或许可证应处于活动状态以允许身份验证?也许我只是没有激活 OneDriveForBusiness 订阅?
提前致谢,
【问题讨论】:
标签: onedrive