gpt4 book ai didi

c# - 如何在 Azure 广告身份验证中停止注销询问您要注销哪个帐户?

转载 作者:行者123 更新时间:2023-11-30 22:54:40 25 4
gpt4 key购买 nike

在我的应用程序中,我使用了 AzureAd 身份验证并且工作正常。但是当我从 AzureAd 身份验证注销我的应用程序时,每次 Microsoft 重定向 url 都要求

Which account do you want to sign out of?

注销方法是

    [HttpGet]
public IActionResult SignOut()
{
var callbackUrl = Url.Action(nameof(SignedOut), "Account", values: null, protocol: Request.Scheme);
return SignOut(
new AuthenticationProperties { RedirectUri = callbackUrl },
CookieAuthenticationDefaults.AuthenticationScheme,
OpenIdConnectDefaults.AuthenticationScheme);
}

SignOut 执行时,应用程序被重定向到 https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri ..... 这个注销 URL。

但它会询问您要退出哪个帐户?我也只用一个帐户登录还是一样问要退出哪个帐户?

喜欢下面

enter image description here

我的问题是如何在不询问要退出哪个帐户的情况下退出 azure ad?

这是 Microsoft 内置的重定向 url 还是需要设置的任何属性来阻止它。

最佳答案

今天无法避免在 v2 端点的注销 URL 上选择帐户的选项。

一个可能的原因是在 Section 5. RP-initiated LogoutOpenID Connect Session Management规范,我们发现以下内容:

At the logout endpoint, the OP SHOULD ask the End-User whether he wants to log out of the OP as well. If the End-User says "yes", then the OP MUST log out the End-User.

这有助于避免恶意应用程序或网站在用户不知情的情况下触发注销,这是一种拒绝服务形式。

关于c# - 如何在 Azure 广告身份验证中停止注销询问您要注销哪个帐户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56056290/

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