简体   繁体   English

当提示=同意并且用户是真实帐户时,Azure SSO错误:AADSTS50020

[英]Azure SSO Error: AADSTS50020 when prompt=consent and user is a live account

I've a MUTITENAT app on my Azure ActiveDirectory. 我在Azure ActiveDirectory上有一个MUTITENAT应用程序。 I'm using it to log in users on my web site. 我正在使用它来登录我的网站上的用户。

When redirecting the user, We were using no 'prompt' parameter. 重定向用户时,我们没有使用“提示”参数。 We don't like this because if the user is already log in azure and then he click the link: is redirected to azure and then is automatically redirected to my site without accepting anything. 我们不喜欢这样,因为如果用户已经登录了azure,然后单击链接:重定向到azure,然后自动重定向到我的网站,而不接受任何内容。

So now, we want the user to accept the permissions. 所以现在,我们希望用户接受权限。 So we are adding 'prompt=consent' parameter when redirecting the user. 因此,我们在重定向用户时添加了'prompt = consent'参数。

The problem is that now every live account that tries to log in, receives an Azure error page with this error message: 问题在于,现在每个尝试登录的真实帐户都会收到带有以下错误消息的Azure错误页面:

AADSTS50020: User account 'xxx@outlook.com' from identity provider 'live.com' does not exist in tenant 'XXX' and cannot access the application 'xxx' in that tenant. AADSTS50020:来自身份提供者“ live.com”的用户帐户“ xxx@outlook.com”在租户“ XXX”中不存在,并且无法访问该租户中的应用程序“ xxx”。 The account needs to be added as an external user in the tenant first. 首先需要将该帐户作为外部用户添加到租户中。 Sign out and sign in again with a different Azure Active Directory user account. 注销并使用其他Azure Active Directory用户帐户再次登录。

More details about the error and my actual configuration: 有关错误和我的实际配置的更多详细信息:

  • I'm using common endpoints to call the api(/common/oauth2/authorize and /common/oauth2/token) 我正在使用公共端点来调用api(/ common / oauth2 / authorize和/ common / oauth2 / token)
  • I've also try to log in even when a live account that was on my tenant. 即使租户上有真实账户,我也尝试登录。 It's also failing 也失败了
  • Also, when I try to log in with an Azure account (whether is on my tenant or a different tenant) it works fine (redirecting the user to my website with code parameter). 另外,当我尝试使用Azure帐户(无论是在我的租户上还是在其他租户上)登录时,都可以正常工作(使用代码参数将用户重定向到我的网站)。

Support for LiveIDs is only available in the v2 endpoint. 仅在v2端点中提供对LiveID的支持。

Based on what you've posted, you're hitting the v1 endpoint. 根据您发布的内容,您将到达v1端点。 In order to move over to v2, you'd need to be calling 为了移至v2,您需要打电话

/common/oauth2/v2.0/authorize
/common/oauth2/v2.0/token

Or if you are using the metadata endpoint to discover the auth endpoints: 或者,如果您正在使用元数据端点来发现身份验证端点:

https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration

There's a few other things you'd need to tweak as part of using the v2 endpoint like using scopes instead of resources. 在使用v2端点时,您还需要进行其他一些调整,例如使用范围而不是资源。 Also, the v2 endpoint doesn't support all flows yet. 另外,v2端点尚不支持所有流。

You can find more info in the Azure AD App Model V2 documentation . 您可以在Azure AD App Model V2文档中找到更多信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用基于live.com的帐户验证用户身份时,AADSTS50020错误 - AADSTS50020 error when authenticating user with live.com based account 当我尝试登录时,Azure 门户显示错误 AADSTS50020 - Azure Portal is showing error AADSTS50020 when I try to log in AADSTS50020 来自身份提供商“live.com”的用户帐户“xxx@zbc.com”在租户“xx-xx-xx-xx”中不存在 C# Winforms 错误 - AADSTS50020 User account 'xxx@zbc.com' from identity provider 'live.com' does not exist in tenant 'xx-xx-xx-xx' Error in C# Winforms 请求访问资源https://graph.windows.net/时出错AADSTS50020 - Error AADSTS50020 when requesting access to resource https://graph.windows.net/ AADSTS50020:我们无法从此api版本为Microsoft帐户发行令牌 - AADSTS50020: We are unable to issue tokens from this api version for a Microsoft account 将 django-microsoft-auth 用于具有 Azure AD 的 SSO 时出现 AADSTS90102 错误 - AADSTS90102 error when using django-microsoft-auth for SSO with Azure AD 通过 Azure AD 身份验证进行单点登录 (SSO) 时出错 - AADSTS50059 - Error while Single Sign On(SSO) via Azure AD Authentication - AADSTS50059 是否可以将Azure Web应用程序配置为不提示用户同意? - Can I configure an Azure Web Application to not prompt for user consent? 尝试同意 Azure VPN 应用程序时出错 - Error when trying to consent Azure VPN application 尝试使用Azure AD登录时出现错误AADSTS65001 - Error AADSTS65001 when trying to login with Azure AD
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM