【发布时间】:2016-08-24 15:59:04
【问题描述】:
我通过此链接为我的应用授予外部帐户访问权限 http://account.activedirectory.windowsazure.com/Consent.aspx?ClientID=2a97adb7-8e24-4b30-9999-f7989af33a31&RequestedPermissions=DirectoryReaders
预期: 接收租户 ID,我的应用程序出现在该外部帐户 http://account.activedirectory.windowsazure.com/ 那里
其实: 我收到了租户 ID,但我的应用没有出现在那个外部帐户中,所以我无法授权
代码:
def get_oauth_url(self, request):
authority = 'https://login.microsoftonline.com'
authorize_url = '{0}{1}'.format(authority, '/common/oauth2/authorize?{0}')
params = {'client_id': (settings.OFFICE365_CLIENT_ID),
'redirect_uri': request.build_absolute_uri(reverse('office365_oauth_return')),
'response_type': 'code',
'state': state,
'resource': 'https://graph.microsoft.com',
'grant_type': 'client_credentials',
}
return authorize_url.format(urlencode(params))
错误:
问题 u'AADSTS70002:验证凭据时出错。 AADSTS50012:身份验证失败 跟踪 ID:516d8605-4dc8-4dbe-9381-b22c49b2d9ee 相关 ID:c8439084-4e3e-4301-8b10-141119be0c9a 时间戳:2016-08-24 15:57:19Z'
【问题讨论】:
-
我强烈建议:1. 清楚地描述您遇到的问题(您期望什么,实际发生了什么) 2. 提供一个您需要帮助的代码示例 3. 正确格式化问题。以目前的形式,它很可能没有得到答复。
标签: python microsoft-graph-api