2

每个人,

我使用新发布的 Graph API v1.0 做了一个小 django 应用程序。我使用 oauth2 协议获取令牌,刷新令牌。当我使用不同的 Office365 开发人员帐户时,一切正常,但我得到了某人使用他的 Office365 家庭版的回报,他根本无法获得授权。

他收到以下错误消息:

{u'correlation_id': u'9e1b1368-e240-4299-9411-f1780ad977e6',
 u'error': u'invalid_grant',
 u'error_codes': [65001],
 u'error_description': u"AADSTS65001: The user or administrator has not     consented to use the application with ID '1db510e8-7ef3-4f8d-9c8b-e6c41015cf34'. Send an interactive authorization request for this user and resource.\r\nTrace ID:     09085256-de74-448b-b481-4d0c4136d115\r\nCorrelation ID: 9e1b1368-e240-4299-9411-    f1780ad977e6\r\nTimestamp: 2016-01-26 11:42:34Z",
 u'timestamp': u'2016-01-26 11:42:34Z',
 u'trace_id': u'09085256-de74-448b-b481-4d0c4136d115'}

是不是只有office365的Developer和business account才能使用Graph API?

非常感谢你的帮助。

问候

4

2 回答 2

0

您是开发单租户应用还是多租户应用?

如果您希望该应用也适用于 Azure AD 上其他租户的用户,则需要启用多租户,否则必须在其他公司的目录中注册。

某些类型的应用程序可能需要组织管理员的同意。更详细的参考下面的链接:

https://azure.microsoft.com/en-us/documentation/articles/active-directory-authentication-scenarios/

于 2016-02-02T08:37:14.093 回答
0

Office 365 租户中的任何用户都可以根据授予的权限访问图形 API。您可以使用测试控制台工具测试您的查询,以确保正确构建您的请求。沙盒控制台工具的链接:

https://apisandbox.msdn.microsoft.com

如果您使用的是 Microsoft Graph Api,我建议您使用此工具:

https://graphexplorer2.azurewebsites.net

希望这可以帮助你。

于 2016-02-04T01:38:39.860 回答