Microsoft Graph 上的 AAD 应用注册Microsoft、Graph、AAD

2023-09-06 17:47:46 作者:傲气逼人°

我正在使用我的管理员帐户为 Azure AD 创建应用注册.我打算创建一个组织应用注册(不是多租户).

I'm creating an app registration for Azure AD using my admin account. I intend to create an organization app registration (not multitenant).

当我通过 Azure 门户手动创建此应用程序时,应用程序会按应有的方式显示.但是当我通过 Microsoft Graph (POST/beta/applications) 创建它时,它不会显示在门户中.但是它在列出应用程序时显示(GET/beta/applications).所以它被清楚地注册了,但没有显示在门户中.

When I create this manually via the Azure Portal, the app shows as it should. But when I create it through the Microsoft Graph (POST /beta/applications), it does not show up in the portal. BUT it shows up when listing applications (GET /beta/applications). So it is clearly registered, but not showing in the portal.

我错过了什么?

我在登录门户时使用的代码中使用了相同的用户.当我查看 te GET 应用列表中的 JSON 结果时,唯一的区别是手动创建的应用具有以下属性:

I am using the same user in code that I'm using logged in to the portal. When I look at the JSON result in te GET app list, the only differences is that the app created manually has the following properties:

"orgRestrictions": ["my-tenant-id-guid"],
"publisherDomain": null,
"api": {
    "acceptedAccessTokenVersion": null,
    ...
}

...而我从代码创建的应用程序具有以下属性:

...and the app I created from code has these properties instead:

"orgRestrictions": [],
"publisherDomain": "mydomain.com",
"api": {
    "acceptedAccessTokenVersion": 2,
    ...
}

有什么想法吗?

推荐答案

此 API 当前为 Azure ADv2"端点创建应用程序.如果您登录到 https://apps.dev.microsoft.com(当然,与通过 API 注册应用程序的帐户相同).

This API currently creates apps for the Azure AD "v2" endpoint. You should be able to see it if you sign in to https://apps.dev.microsoft.com (with the same account used to register the app via the API, of course).