Azure AD B2C-从所有会话中注销用户 [英] Azure AD B2C - Sign out a user from all sessions

查看:150
本文介绍了Azure AD B2C-从所有会话中注销用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个网站使用一个B2C租户.我被要求进行设置,以便当用户退出一个网站时,全部退出.

I have 3 websites using a single B2C tenant. I have been asked to set it up so that when a user signs out of one website, sign out of them all.

同样,如果他们的帐户被删除.

Likewise if their account is deleted.

我认为我必须在每个请求上都引入一个对Azure的调用,以确定用户是否仍在登录,但是据我所知,没有一个Graph API终结点可以让我确定用户状态.

I thought that I would have to introduce a call to Azure on every request to determine if the user is still logged in, but as far as I can see, there isn't a Graph API endpoint that would allow me to determine the user status.

我在想这个错误的方式吗?有没有办法使用B2C,Graph API,Active Directory客户端等轻松地做到这一点?

Am I thinking about this the wrong way? Is there a way to do this easily using B2C, Graph API, the Active Directory client etc.?

例如,在设置OpenIdConnectAuthenticationOptions时可能会有一个选项.

Maybe there is an option when setting up the OpenIdConnectAuthenticationOptions for example.

推荐答案

我可能会迟到.但是,如果有帮助.交流到文档

I might late. But if that helps. A.c to docs

当您将用户重定向到Azure AD B2C注销端点(用于OAuth2和SAML协议)时,Azure AD B2C会从浏览器中清除用户的会话.但是,用户仍可能登录到使用Azure AD B2C进行身份验证的其他应用程序.为了使这些应用程序能够同时注销用户,Azure AD B2C将HTTP GET请求发送到用户当前登录的所有应用程序的已注册LogoutUrl.

When you redirect the user to the Azure AD B2C sign-out endpoint (for both OAuth2 and SAML protocols), Azure AD B2C clears the user's session from the browser. However, the user might still be signed in to other applications that use Azure AD B2C for authentication. To enable those applications to sign the user out simultaneously, Azure AD B2C sends an HTTP GET request to the registered LogoutUrl of all the applications that the user is currently signed in to.

应用程序必须通过清除标识用户的任何会话并返回200响应来响应此请求.如果要在应用程序中支持单点注销,则必须在应用程序的代码中实现LogoutUrl.

Applications must respond to this request by clearing any session that identifies the user and returning a 200 response. If you want to support single sign-out in your application, you must implement a LogoutUrl in your application's code.

这称为单点退出". 请参考 https://docs.microsoft.com/zh-CN/azure/active-directory-b2c/session-overview#single-sign-out

This is called single sign out . Please refer to https://docs.microsoft.com/en-us/azure/active-directory-b2c/session-overview#single-sign-out

这篇关于Azure AD B2C-从所有会话中注销用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆