Azure AD 图 API 使用本地域

Azure AD graph API using on-premise domain

我正在尝试访问 Azure AD 图 API。我已成功将用户添加到我的测试环境 (ADFS) 并将他们的域更改为 {mytestdomain}.onmicrosoft.com。使用 Azure AD Connect 的密码同步有效。

现在我已经相应地设置了生产环境(包括ADFS)并且我现在正在同步用户,但显然不能将域更改为{mydomain}.onmicrosoft.com.用户现在有{mydomain}.net 并且我正在将用户同步到 Azure AD.

中的已验证域

尝试访问时 https://login.microsoftonline.com/{mydomain}.net/oauth2/token 使用以下内容(是的,我知道不推荐 grant_type,但这不是重点)

grant_type: password
username: {user}@{mydomain}.net
password: XXXX
resource: https://graph.windows.net
client_id: {Guid}

我得到:

AADSTS70002: Error validating credentials.
AADSTS50126: Invalid username or password

如果我使用像 admin@{mydomain}.onmicrosoft.com 这样的管理员,它工作正常。

在 Azure 门户中,我尝试将主域从 {mydomain}.onmicrosoft.com 更改为 {mydomain}.net,但没有任何区别。

管理门户中说:

"To configure {mydomain} for federated sign-on to your Azure Active Directory, run Azure AD Connect on your local network."

使用图表 API 时是否也适用?我必须在我的本地网络上设置联盟还是有其他方法?

In the azure portal I have tried changing the primary domain from {mydomain}.onmicrosoft.com to {mydomain}.net, but it does not make a difference.

我不清楚您同步步骤的详细信息。除了在 Azure AD 中验证您的自定义域外,您还需要一些其他配置,例如 Azure AD 登录配置。您可以在 this document.

中查看更多详细信息

Does that apply when using the graph api as well? Do I have to setup federation on my local network or is there another way around?

是的,由于您使用的是 ADFS,因此您需要使用 Federated SSO (with Active Directory Federation Services (AD FS)) 以允许您的用户使用相同的密码登录云和本地资源。

您还可以在 this official document 中查看有关 Azure AD Connect 用户登录选项的更多详细信息。

希望对您有所帮助!