我正在使用Azure Active Directory身份验证。对于经过身份验证的用户,登录成功,但是注销不会返回到原始站点/登录页面,而是重定向到 https://www.msn.com/en-in 。
在Azure Active Directory上,我设置了回复URL,注销URL等。
答案 0 :(得分:0)
您是否已确保注销URL与帐户控制器中的URL匹配?您的帐户控制器需要有一个Signout和EndSession方法。我的控制器中的代码如下所示:
public void SignOut()
{
// Send an OpenID Connect sign-out request.
HttpContext.GetOwinContext().Authentication.SignOut(
OpenIdConnectAuthenticationDefaults.AuthenticationType, CookieAuthenticationDefaults.AuthenticationType);
}
public void EndSession()
{
// If AAD sends a single sign-out message to the app, end the user's session, but don't redirect to AAD for sign out.
HttpContext.GetOwinContext().Authentication.SignOut(CookieAuthenticationDefaults.AuthenticationType);
}
然后,您在应用程序注册中的注销URL需要与帐户控制器中的注销URL相匹配。在此处的示例中为:https://myapp.azurewebsites.net/Account/EndSession