【发布时间】:2020-02-06 12:40:38
【问题描述】:
我在 Azure 中注册了一个具有以下配置权限的应用:
在我的应用程序中,我使用以下 url 启动一个 oauth 流程(使用 XXXXXXX 编辑参数):
https://login.microsoftonline.com/common/oauth2/authorize
?client_id=XXXXXXX
&grant_type=client_credentials
&redirect_uri=XXXXXXX
&resource=https%3A%2F%2Foutlook.office365.com
&response_type=code&scope=openid+email+profile+full_access_as_app
&state=XXXXXXX
我的用户两次获得相同的同意屏幕(注意不同的 URL):
然后:
然后他们被重定向到redirect_url。
在回调中,大多数时候我得到:
access_denied | AADSTS650051: Claim is invalid: User.Read does not exist in client application's RequiredResourceAccess.
并且该应用程序未添加到 Azure 门户中用户的授权应用程序列表中。
但是,有时流程会起作用。
应用程序清单中的相关部分似乎是:
"oauth2Permissions": [
{
"adminConsentDescription": "Allow the application to access XXXXXX on behalf of the signed-in user.",
"adminConsentDisplayName": "Access XXXXXX",
"id": "XXXXXX",
"isEnabled": true,
"lang": null,
"origin": "Application",
"type": "User",
"userConsentDescription": "Allow the application to access XXXXXX on your behalf.",
"userConsentDisplayName": "Access XXXXXX",
"value": "user_impersonation"
}
],
问题:
- 为什么他们两次获得相同的同意对话框?我可以避免吗?
- 知道我的设置可能有什么问题并且流程不确定吗?
【问题讨论】:
标签: azure azure-active-directory