需要在地址栏中没有ReturnURL的ASP.NET安全性

问题描述 投票:0回答:1

将感谢一些.NET安全指南。

我已经阅读了地址栏中的Forms Auth如何使用“ ReturnURL”的信息。

我需要安全解决方案,该解决方案不会在浏览器地址栏中显示ReturnURL。 (顺便说一句,我不需要ReturnURL,因为我希望在登录后返回主页;不需要返回先前查看的页面。)

所以,我不能使用Forms Auth?因为始终将ReturnURL放在地址栏中,所以可以识别Web上具有Forms Auth的.NET Web应用程序吗?

对于面向Web的.NET网站,开发人员将使用什么代替Forms Auth?人们是从头开始编写自己的安全模块吗?

请告知。谢谢。

asp.net security authentication returnurl
1个回答
0
投票

您使用owin吗?如果这样做,则可以删除returnUrl,但是关于它的安全性没有任何帮助

    //Account/Login
    [AllowAnonymous]
    public ActionResult Login(string returnUrl)
    {
        ViewBag.ReturnUrl = returnUrl;
        return View();
    }

    //
    // POST: /Account/Login
    [HttpPost]
    [AllowAnonymous]
    [ValidateAntiForgeryToken]
    public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
    {
        //your code
        //...
        //...
    }
© www.soinside.com 2019 - 2024. All rights reserved.