gpt4 book ai didi

azure - 在 azure 应用程序注册中进行身份验证时,我收到错误 AADSTS50020

转载 作者:行者123 更新时间:2023-12-03 02:02:06 24 4
gpt4 key购买 nike

当我尝试登录在 azure 中的应用注册中创建的应用时,出现此错误:

AADSTS50020: User account '***@hotmail.com' from identity provider'live.com' does not exist in tenant 'NAMETENANT' and cannot access theapplication 'CLIENTID'(NAMEAPP) in that tenant. The account needs tobe added as an external user in the tenant first. Sign out and sign inagain with a different Azure Active Directory user account.

我使用的登录流程是授权码流程:

  1. Generate code:

获取:

https://login.microsoftonline.com/TENANTID/oauth2/v2.0/devicecode?client_id=CLIENTID

表单编码:

client_id,范围

当我输入代码时,我收到错误:AADSTS50020。这些是我在 azure 门户中的设置:https://1drv.ms/u/s!AhpypwlrW5KohIEh6wPVtvoe1R-RPA?e=FLQ0sD

我希望可以使用任何 Microsoft 帐户(个人或 365),但如果个人帐户无法使用,我也可以。这是我第一次使用 azure,所以我不确定我错过了什么,我有一个免费帐户。

最佳答案

我尝试在我的环境中重现相同的结果,并得到如下结果:

如果 Azure AD 应用程序未配置为授权 Multi-Tenancy (其他组织/个人帐户用户)或未使用 common 端点。

要解决该错误,请尝试将 Azure AD 应用程序配置为“任何组织目录(任何 Azure AD 目录 - Multi-Tenancy )中的帐户和个人 Microsoft 帐户”,如下所示:

enter image description here

并确保在授权用户时使用通用端点,如下所示:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize? 

client_id=ClientID
&response_type=code
&redirect_uri=https://jwt.ms
&response_mode=query
&scope=https://graph.microsoft.com/.default
&state=12345

enter image description here

使用个人帐户成功生成代码,如下所示:

enter image description here

注意:

  • 对于单租户应用程序,请使用 TenantID 授权端点并将应用程序注册为仅此组织目录中的帐户(仅限 Contoso - 单租户)并使用TenantID 端点。
  • 对于 Multi-Tenancy 应用程序(对于其他组织),将应用程序注册为任何组织目录(任何 Azure AD 目录 - Multi-Tenancy )中的帐户和组织端点。
  • 对于 Multi-Tenancy 应用程序(对于其他组织和个人帐户),将应用程序注册为(任何 Azure AD 目录 - Multi-Tenancy )和个人 Microsoft 帐户(例如 Skype、Xbox)> 并使用通用端点。

当我尝试使用TenantID授权端点并使用个人帐户登录时,出现如下错误:

https://login.microsoftonline.com/TenanID/oauth2/v2.0/authorize? 

client_id=ClientID
&response_type=code
&redirect_uri=https://jwt.ms
&response_mode=query
&scope=https://graph.microsoft.com/.default
&state=12345

enter image description here

关于azure - 在 azure 应用程序注册中进行身份验证时,我收到错误 AADSTS50020,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75783208/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com