How to signout from an Azure Application?(转载)
问:
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.
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
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).
答:
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.
The format of a sign out URI is:
https://login.microsoftonline.com/{0}/oauth2/logout?post_logout_redirect_uri={1}
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环境,对应的URI格式如下:
https://login.chinacloudapi.cn/{0}/oauth2/logout?post_logout_redirect_uri={1}
注意上面post_logout_redirect_uri参数的值,必须是编码后的URI查询字符串,例如如果post_logout_redirect_uri参数的值是:http://localhost:9081/,那么应该写为下面的格式:
https://login.chinacloudapi.cn/b63fb916-ea59-81ea-8f3f-d70a622a1a80/oauth2/logout?post_logout_redirect_uri=http%3A%2F%2Flocalhost%3A9081
But this does not clear the browser cookies. You may have to explicitly delete the cookies from your Request Object:
foreach (string cookie in HttpContext.Current.Request.Cookies.AllKeys) { HttpContext.Current.Response.Cookies[cookie].Expires=DateTime.Now.AddDays(-);}
How to signout from an Azure Application?(转载)的更多相关文章
- Azure Application Insights REST API使用教程
本文是Azure Application Insights REST API的简单介绍,并会包含一个通过Python消费API的示例/小工具. 新加入的team中的一项工作是制作日常的运维报表,制作方 ...
- Azure Application Gateway(一)对后端 Web App 进行负载均衡
一,引言 今天,我们学习一个新的知识点-----Azure Application Gateway,通过Azure 应用程序网关为我么后端的服务提供负载均衡的功能.我们再文章头中大概先了解一下什么是应 ...
- Azure Application Gateway(二)对后端 VM 进行负载均衡
一,引言 上一节有讲到使用 Azure Application Gateway 为我们后端类型为 Web App 的 Demo 项目提供负载均衡,Azure Application Gateway 的 ...
- Azure Application Gateway (3) 设置URL路由
<Windows Azure Platform 系列文章目录> 在之前的文章中,笔者介绍了Azure Web App可以设置URL路由.如下图: 在这里笔者简单介绍一下,首先我们还是创建以 ...
- Azure Application Gateway (4) 设置URL路由 - PowerShell
<Windows Azure Platform 系列文章目录> 本文将介绍如果使用Azure PowerShell,创建Azure Application Gateway URL Rout ...
- Azure Application Gateway (1) 入门
<Windows Azure Platform 系列文章目录> 请读者注意,Azure Application Gateway在ASM模式下,只能通过PowerShell创建 具体可以参考 ...
- Azure Application Gateway (5) Application Gateway SSL Offload配置
<Windows Azure Platform 系列文章目录> 之前有个客户提出了一个需求,他们的互联网访问的架构分为两种: 1.第一层是使用Azure Application Gatew ...
- Azure Application Gateway (2) 面向公网的Application Gateway
<Windows Azure Platform 系列文章目录> 本章将介绍如何创建面向公网的Application Gateway,我们需要准备以下工作: 1.创建新的Azure Reso ...
- 使用Azure Application Insignhts监控ASP.NET Core应用程序
Application Insignhts是微软开发的一套监控程序.他可以对线上的应用程序进行全方位的监控,比如监控每秒的请求数,失败的请求,追踪异常,对每个请求进行监控,从http的耗时,到SQL查 ...
随机推荐
- VMWare虚拟机出现问题
软件版本:VMware ESXi 5.5.0 服务器型号: Dell R720 问题经过: 某天ssh登录其中一个虚拟机,报错:kernel:BUG: soft lockup - CPU#6 stuc ...
- 面向对象(四)--绑定方法与非绑定方法(classmethod、staticmethod装饰器)
一.绑定方法与非绑定方法 1.绑定方法(绑定给谁,谁来调用就自动将它本身当作第一个参数传入): (1)绑定给对象的方法:在类内部定义的函数(没有被任何装饰器修饰的)默认就是绑定给对象用的. (2)绑定 ...
- 一探istio-proxy(envoy)容器里的秘密
今天,在测试环境跑通了istio. 惭愧,是用MicroK8s跑的,其它环境,不敢呀. 基本功能都OK了. 在运行了istio-injection=enabled之后,每个pod运行时,会多一个ist ...
- python基础语法17 面向对象4 多态,抽象类,鸭子类型,绑定方法classmethod与staticmethod,isinstance与issubclass,反射
多态 1.什么是多态? 多态指的是同一种类型的事物,不同的形态. 2.多态的目的: “多态” 也称之为 “多态性”,目的是为了 在不知道对象具体类型的情况下,统一对象调用方法的规范(比如:名字). 多 ...
- shell脚本如何判断文件大小
转自:https://blog.csdn.net/lovegengxin/article/details/80762329 1 .ls -lls -l $filename | awk '{print ...
- HDU6223 && 2017沈阳ICPC: G. Infinite Fraction Path——特殊图&&暴力
题意 给定一个数字串,每个位子都能向(i*i+1)%n的位子转移,输出在路径上.字典序最大的.长度为n的串($n \leq 150000$). 分析 先考虑一个暴力的方法,考虑暴力每个x,然后O(n) ...
- Java 数组ArrayList语法
恶补基础,记录一下数组ArrayList的常用语法 1.导入 import java.util.ArrayList; 2.定义数组list ArrayList<类名> list = new ...
- .Net反射-TypeDescriptor
.Net中提供了两种方式访问类型的元数据:System.Reflection命名空间中提供的反射API和TypeDescriptor类.反射适用于所有类型的常规机制,它为类型返回的信息是不可扩展的,因 ...
- ABP 后台调用接口 获取返回的数据
原文:https://www.cnblogs.com/i3yuan/p/10703500.html insert 简单测试: public void test8() { string url = &q ...
- 5-STM32物联网开发WIFI(ESP8266)+GPRS(Air202)系统方案安全篇(配置MQTT的SSL证书,验证安全通信)
4-STM32物联网开发WIFI(ESP8266)+GPRS(Air202)系统方案安全篇(为域名申请SSl证书) 前面的准备工作终于完了 复制这两个证书 放到云端MQTT的这个位置,其实放哪里都可以 ...