如何从 Azure 应用程序注销? [英] How to signout from an Azure Application?

查看:19
本文介绍了如何从 Azure 应用程序注销?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 Azure AD 应用程序和一个 Web 应用程序.Azure AD 应用程序使用 AAD 身份验证.这很好用.当我转到我的 URL 并且我没有通过身份验证时,我必须输入我的凭据.当我输入我的凭据时,我会被转发到我的应用程序.

I have created a Azure AD application and a Web App. The Azure AD Application uses AAD Authentication. This works well. When I go to my URL and I am not authenticated, I have to enter my credentials. When I enter my credentials, I am forwarded to my application.

但是问题来了.我如何退出.我找到了 这个问题,我想实施选项 2:不退出使用代码,但使用 Azure AD 提供的链接.关键是,我不知道在哪里配置它.他说

But then comes the problem. How do I sign out. I have found this question and I wanted to implement option 2: not signing out using code, but using links Azure AD provides. The point is, I have no clue where to configure this. He states

添加一些特定的登录和注销链接

Add some specific links for logging in and logging out

但是在哪里?我可以在 Azure 的哪个位置以及哪个门户(新的或旧的)中进行配置?他还提供了一个示例链接,但我不明白这个示例(我对 Azure 有点陌生).

But where? Where in Azure and in which portal (new or old) can I configure this? He also provided a link with a sample, but I don't understand this sample (I kind of new to Azure).

推荐答案

您可以做的是在您的应用程序中构建一个注销 URI,当用户单击 Logout 链接或按钮时,您将您的用户重定向到该 URI.

What you can do is construct a sign out URI in your application and when the user clicks on the Logout link or button, you redirect your users to that URI.

登出 URI 的格式为:

The format of a sign out URI is:

https://login.microsoftonline.com/{0}/oauth2/logout?post_logout_redirect_uri={1}

其中 {0} 是租户 ID 或 Azure AD 名称 (something.onmicrosoft.com),{1} 是链接到您的应用程序,在 Azure AD 端完成注销过程后,用户将被重定向回来.

Where {0} is the Tenant Id or the Azure AD name (something.onmicrosoft.com) and {1} is the link to your application where a user will be redirected back after the sign out process is complete at Azure AD end.

这篇关于如何从 Azure 应用程序注销?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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