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

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

问题描述

我已经创建了一个Azure AD应用程序和一个Web App. 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链接或按钮时,您会将用户重定向到该URL. 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的格式为:

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天全站免登陆