azure-active-directory - 授予管理员同意 - 未考虑授予的同意
问题描述
我有一个 JavaScript 应用程序,使用 MSAL.js 1.3.0。系统提示我登录屏幕,我可以登录。但无论我如何在 Azure 门户中配置应用程序,我登录后总是收到以下消息:
因此,我授予了应用程序管理员同意:(几周前委派权限不需要。此外,下面的页面根本没有显示“需要管理员同意”)
但是,行为仍然没有改变。我无法通过“需要管理员批准”消息。
我的编码在这里:
config: {
msalConfig: {
auth: {
clientId: "b273e5a6-8940-481b-9c87-1b51310ff88c"
},
cache: {
cacheLocation: 'localStorage',
storeAuthStateInCookie: true
}
},
graphBaseEndpoint: "https://graph.microsoft.com/v1.0/",
userInfoSuffix: "me/",
queryMessagesSuffix: "me/messages?$search=\"$1\"&$top=150",
scopeConfig: {
scopes: ['User.Read', 'Mail.Read']
}
},
onInit: function () {
this.oMsalClient = new Msal.UserAgentApplication(this.config.msalConfig);
//check if the user is already signed in
if (!this.oMsalClient.getAccount()) {
this.oMsalClient.loginPopup(this.config.scopeConfig).then(this.fetchUserInfo.bind(this));
} else {
this.fetchUserInfo();
}
}
这是我的应用程序清单:
{
"id": "HERE-WOULD-BE-AN-ID",
"acceptMappedClaims": null,
"accessTokenAcceptedVersion": 2,
"addIns": [],
"allowPublicClient": null,
"appId": "b273e5a6-8940-481b-9c87-1b51310ff88c",
"appRoles": [],
"oauth2AllowUrlPathMatching": false,
"createdDateTime": "2020-06-09T10:31:12Z",
"groupMembershipClaims": null,
"identifierUris": [],
"informationalUrls": {
"termsOfService": null,
"support": null,
"privacy": null,
"marketing": null
},
"keyCredentials": [],
"knownClientApplications": [],
"logoUrl": null,
"logoutUrl": null,
"name": "2020-06-09 - Fiori Sandbox Test2",
"oauth2AllowIdTokenImplicitFlow": true,
"oauth2AllowImplicitFlow": true,
"oauth2Permissions": [],
"oauth2RequirePostResponse": false,
"optionalClaims": null,
"orgRestrictions": [],
"parentalControlSettings": {
"countriesBlockedForMinors": [],
"legalAgeGroupRule": "Allow"
},
"passwordCredentials": [],
"preAuthorizedApplications": [],
"publisherDomain": "d063937domain.onmicrosoft.com",
"replyUrlsWithType": [
{
"url": "https://d063937trial-d063937trialb-devspace-msgraph-ui.cfapps.eu10.hana.ondemand.com/ui/index.html",
"type": "Web"
}
],
"requiredResourceAccess": [
{
"resourceAppId": "00000003-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "570282fd-fa5c-430d-a7fd-fc8dc98a9dca",
"type": "Scope"
},
{
"id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d",
"type": "Scope"
}
]
}
],
"samlMetadataUrl": null,
"signInUrl": null,
"signInAudience": "AzureADandPersonalMicrosoftAccount",
"tags": [],
"tokenEncryptionKeyId": null,
"verifiedPublisher": {
"displayName": null,
"verifiedPublisherId": null,
"addedDateTime": null
}
}
PS:我不是 JavaScript 开发人员,只是从同事那里拿了一个最近工作的应用程序并想使用它。如果有什么遗漏,请告诉我。
干杯,马克斯
解决方案
如果您希望最终用户可以同意应用代表他们访问公司数据,您需要使用管理员帐户登录 Azure 门户以启用此功能。
转到Azure Active Directory ->企业应用程序->用户设置,为“用户可以同意应用代表他们访问公司数据”选择是。
如果您希望最终用户可以请求访问需要管理员同意的应用程序,您可以配置管理员同意工作流。
推荐阅读
- excel - 基于单元格或字体颜色的总和/小计可见单元格
- linux - 如何从 shell 脚本重新加载 /etc/environment
- javascript - 有没有办法运行js。python中的解析器并检索数据?
- python - Ubuntu:_tkinter.TclError:没有显示名称,也没有 $DISPLAY 环境变量
- nestjs - Nestjs 无请求调用请求范围服务
- c - bluenrg-ms/stm32F4 : Hci 数据包通过 spi
- python-3.x - Pandas 数据透视表错误:Python 中的 Grouper 和轴必须相同长度
- tar - 将 tar 文件提取到特定的根目录,而不考虑 tar 中的根目录
- php - $_POST php - 无法从输入中获取 FORM 数据
- android - Android OS 9.0、BLE 5.0 特定问题从 BluetoothGatt 获取服务列表