繁体   English   中英

所有应用程序的Azure AD B2C注销

[英]Azure AD B2C logout from all apps

我已经使用Azure AD为wordpress和Jira设置了2个saml应用程序。 我被要求按照以下流程设置应用程序:1.用户从WordPress网站注销2.用户从Azure AD注销3.破坏与其他单个应用程序的会话,这些应用程序与活动用户会话具有单点登录功能可能是JIRA和其他应用程序)。

我已经完成了前两个步骤,但在第三个步骤中却苦苦挣扎。 Azure技术支持团队表示,他们提供了在注销时销毁所有应用程序会话的功能,但是我找不到有关如何进行设置的任何文档。

任何帮助,将不胜感激。 谢谢。

如果要销毁所有应用程序的用户会话,则可能需要使用会话管理 这意味着使用ADAL方法正确注销。 如果应用程序依赖于Azure AD发出的访问令牌,则应该调用注销事件处理程序。

范例(C#)

HttpContext.GetOwinContext().Authentication.SignOut(OpenIdConnectAuthenticationDefaults.AuthenticationType, CookieAuthenticationDefaults.AuthenticationType)

它还应该通过调用Session.Abandon()方法来破坏用户的会话。 以下方法显示了用户注销的安全实现:

[HttpPost]
[ValidateAntiForgeryToken]
public void LogOff()
{
    string userObjectID = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value;
    AuthenticationContext authContext = new AuthenticationContext(Authority + TenantId, new NaiveSessionCache(userObjectID));
    authContext.TokenCache.Clear();
    Session.Clear();
    Session.Abandon();
    Response.SetCookie(new HttpCookie("ASP.NET_SessionId", string.Empty));
    HttpContext.GetOwinContext().Authentication.SignOut(
        OpenIdConnectAuthenticationDefaults.AuthenticationType,
        CookieAuthenticationDefaults.AuthenticationType);
}

请参阅本文档中有关Seesion Management的更多详细信息。

请参阅本文档中有关ADAL的更多详细信息。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM