【发布时间】:2021-06-29 03:34:11
【问题描述】:
上下文
我了解 Azure AD B2C 对 oauth2 client_credentials 流有限制,但我发现可以向 AD 而不是 AD B2C 再次请求令牌。
据我了解,这是对授权域的更改,所以不要使用:
https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/{policy}/oauth2/v2.0/token
我们应该使用:
https://login.microsoftonline.com/032bba1a-4a23-41d0-8713-69ad1a38cf69/oauth2/v2.0/token
问题
我的问题是,如果我向它添加一个范围,例如 https://graph.microsoft.com/openid/.default 或来自不同应用程序的其他应用程序(这是我打算使用的应用程序)https://{tenant}.onmicrosoft.com/backendtestapi/api/.default,我会收到此错误:
AADSTS500011: The resource principal named https://graph.microsoft.com/openid was not found in the tenant named xxxxx-xxxxx-xxxxx-xxxxx. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant
如果我请求此范围,我不明白为什么会出现错误。有没有大神赐教?
非常感谢!
【问题讨论】:
-
该范围无效。关注这个:docs.microsoft.com/en-us/graph/…。对于自定义应用程序和范围,它应该采用这种格式
https://{tenant}.onmicrosoft.com/something/something/.default- 它在菜单中给出准确的值。 -
https://{tenant}.onmicrosoft.com/something/something/.default和https://{tenant}.onmicrosoft.com/backendtestapi/api/.default之间有什么区别?无法理解您的建议。
标签: azure oauth-2.0 azure-ad-b2c