首页 > 其他分享 >How to redirect to a specific web page after sign out from Entra ID

How to redirect to a specific web page after sign out from Entra ID

时间:2024-05-14 18:21:27浏览次数:14  
标签:redirect web Entra sign ID page out

How to redirect to a specific web page after sign out from Entra ID

With some more digging I found the below changes resulted in a successful redirect to a page of my choosing.

I found that if the SignedOutCallbackPath is set to anything other than /signout-oidc, then on sign out, the user gets redirected to /Account/SignOut. This happens regardless of what SignedOutRedirectUri gets set to, since it's hardcoded into the AccountController provided as part of the Microsoft.Identity.Web.UI nuget package.

This lead to the following OpenIdConnectOptions configuration in Program.cs

builder.Services.Configure<OpenIdConnectOptions>(
    OpenIdConnectDefaults.AuthenticationScheme,
    options => {
        options.SignedOutCallbackPath = "/signout-callback-oidc";
        options.SignedOutRedirectUri = "/Account/SignOut";
});

Next, I implemented my own AccountController, with a route that matches the signout redirect URI /Account/Signout. In this controller action, I redirect to the page I want to display:

public class AccountController : Controller
{
    public new IActionResult SignOut()
    {
        base.SignOut();

        return RedirectToAction("Index", "Home");
    }
}

Lastly, I updated my App Registration in Entra ID, setting "Front-channel logout URL" to match that of the SignedOutCallbackPath property:

Users are now correctly redirected to the public home page of the site once they've successfully signed out.

A special thanks to Jalpa Panchal, whose response set me on the path of providing a custom implementation for URI that the site is being redirected to.

 

标签:redirect,web,Entra,sign,ID,page,out
From: https://www.cnblogs.com/chucklu/p/18191881

相关文章

  • Web3连接以太网
    1.InfuraInfura是一种托管服务,提供对各种区块链网络的安全可靠访问,消除了管理区块链基础设施的复杂性,使开发者能够专注于构建创新的Web3应用程序。Infura作为连接应用程序与区块链网络的重要桥梁,为开发者提供强大的API来与区块链进行交互、部署和管理智能合约等等。无论......
  • 如何优雅的使用aop记录带参数的复杂web接口日志
    1、新建一个自定义注解packagecom.ninestar.userFile.aop.annotation;importcom.ninestar.userFile.constant.Constants;importjava.lang.annotation.*;/***系统日志注解**@AuthorTring*@Date2024年5月7日14:31:18*/@Target(ElementType.METHOD)@Re......
  • web前端面试题(一直更新)
    一、Vue1、v-show和v-if不同(1)实现方式v-if是一种条件渲染指令,它会根据表达式的值来插入或删除元素。当表达式的值为真时,元素会被插入到DOM中,否则会从DOM中删除。v-show是一种简单的显示/隐藏指令,它会根据表达式的值来显示或隐藏元素。当表达式的值为真时,元素会被显示,否则会......
  • WEB自动化测试-CSS定位
    CSS相对定位:1、可维护性更强2、语法更加简洁3、可以解决复杂定位场景调试方法:1、进行浏览器的console:2、输入:$(""),输入内有字符串和外层字符串相反,外单内双,外双内单CSS基础语法4方式1、id:$("#site-logo")格式:$("#+id")2、class:(".logo-big")格式:$("......
  • WEB UI
    1.在IDE中编写Flink代码,查看WebUI,从而来了解Flink程序的运行情况<dependency><groupId>org.apache.flink</groupId><artifactId>flink-runtime-web</artifactId><version>${flink.version}</version></dependency&......
  • Stable Diffusion WebUI 绘画
    配置环境介绍目前平台集成了StableDiffusionWebUI的官方镜像,该镜像中整合如下资源:立即免费体验:https://gpumall.com/login?type=register&source=cnblogsStableDiffusionWebUI版本:v1.7.0Python版本:3.10.6Pytorch版本:2.0.1CUDA版本:11.8Xformers版本:0.0.20Gradio版本......
  • Django 安全性与防御性编程:如何保护 Django Web 应用
    title:Django安全性与防御性编程:如何保护DjangoWeb应用date:2024/5/1320:26:58updated:2024/5/1320:26:58categories:后端开发tags:CSRFXSSSQLUploadHTTPOnlyPasswordSession跨站请求伪造(CSRF)跨站请求伪造(CSRF)是一种常见的网络攻击,它利用用户的身份......
  • 用curl调试简单webapi
    curl,即用户url。windows自带(据说新版的linux也自带),可以发送请求,用来简单调试webapi很合适。使用:cmd下直接输入命令。 例子:对于模型类 publicrecordStu(stringXm,intNl); post表单:curl-XPOST-d"Xm=ZS&Nl=20"http://localhost:5205/weatherforecast接收的weba......
  • Python3开发一个web项目
    准备工作#安装Web框架pipinstallDjango#创建一个项目pythondjango-admin.pystartprojectitstyle#切换目录cditstyle#创建Apppythonmanage.pystartappnovel一般一个项目有多个app,当然通用的app也可以在多个项目中使用,然后启动服务:#默认端口是800......
  • 使用 Docker 部署 WebTop 运行 Linux 系统
    1)项目介绍GitHub:https://github.com/linuxserver/docker-webtopWebTop它是一个基于Linux(Ubuntu和Alpine两种版本)的轻量级容器,具有在浏览器中运行的完整桌面环境,具有基本的窗口管理器、像素完美的渲染分辨率、音频支持、剪贴板支持、屏幕键盘支持,以及用于上传/下载的远程......