The data protection operation was unsuccessful on Azure using OWIN / Katana

前端 未结 7 1020
没有蜡笔的小新
没有蜡笔的小新 2020-12-08 19:37

I\'m trying to implement password reset on an OWIN/Katana based ASP.NET MVC website running in Azure.

It works fine when run locally but fails in production.

7条回答
  •  温柔的废话
    2020-12-08 20:33

    Getting the UserManager from the Owin Pipeline, as its set in App_Start/Startup.Auth.cs, works on Azure. I'm unsure as to how this works specifically. The DpApi should work in Azure with the solution described in the first link.

    If the DpApi has a static machine key set in Web.config all server machines will be able to decrypt the encrypted data created by another machine in your webfarm is the understanding behind this.

    (code as given in the standard template - from AccountController.cs)

     private UserManager userManager;
        public UserManager UserManager
        {
            get { return userManager ?? HttpContext.GetOwinContext().GetUserManager(); }
            private set { userManager = value; }
        }
    

提交回复
热议问题