asp.net - Window 10 1 月 14 日更新后重定向框架内的表单身份验证问题
问题描述
我在我的 asp.net 应用程序中使用表单身份验证,我的应用程序可以用作打孔,其他应用程序可以使用我的应用程序进行先前的身份验证,但是,它在收到 Microsoft 的 Windows 10 更新后突然停止工作。
我的目录应用程序过去是在框架中打开的,流程是:在收到打孔请求后,请求正在被验证、验证,然后系统将使用 response.redirect 将其重定向到目录主页。但是,我们在重定向到主页时失去了控制并登陆了表单身份验证登录 url。
下面是验证打孔请求并重定向到主页的示例代码(即 default.aspx)
private void AuthenticatePunchoutUser()
{
String punchoutid = Request["punchout"].ToString();
//Create a PunchoutDB object and Authenticate the punchout request
ePlus.Catalog.DataTypes.cXMLPunchout oPunchout = null;
try
{
ePlus.Catalog.DataTypes.cXMLPunchoutDB oPunchoutDB = new ePlus.Catalog.DataTypes.cXMLPunchoutDB();
oPunchout = oPunchoutDB.AuthenticatePunchout(punchoutid);
}
catch (System.Exception e2)
{
ePlus.Data.Global.Log.Error("Error authenticating punchout session with punchoutid= " + punchoutid, e2);
throw;
}
//Log that the user was authenticated
ePlus.Data.Global.Log.Info("Authenticated punchout User " + strUserName);
//Tell Forms Authentication that the user is valid
System.Web.Security.FormsAuthentication.SetAuthCookie(oUser.Login, false);
String strRedirect = "~/Secure/Default.aspx";
//Redirect
this.Page.Response.Redirect(strRedirect);
}
在 response.redirect 上,应用程序重定向到登录页面(即表单身份验证登录 url)。
解决方案
推荐阅读
- postgresql - 在 Postgres 中防止空字符串的全局方法
- flutter - firebase_storage 和 integration_test 出错
- vim - 如何在没有弹出菜单的情况下在 Vim 中自动输入自动完成项
- python - Matplotlib 的直方图图例为破折号
- laravel - Laravel + Vuejs:如何将图像链接到 Laravel 公共文件夹
- java - Jackson YAML 序列化 - 防止多行写入
- node.js - Firebase 云函数 - 何时返回 Promise - NodeJs
- mysql - SQL group by 通过 id 获取另一个表值
- azure - 将 .net 核心服务迁移到 Azure 如何仅在需要时运行
- amazon-dynamodb - DynamoDB 跟踪 2 个表之间的执行情况