We have an MVC application that has an authentication view / controller for personalized forms. The controller checks everything and then makes a call to FormsAuthentication.RedirectFromLoginPage.
At this point in Global.asax we will receive a call to Application_OnAuthenticateRequest, from where we will get information about Context.User and make another call to collect information related to this account, which we then store in their Context.User and System.Threading.Thread .CurrentPrincipal. We also cache this information a bit, since in our system we get what we need dear, which leads to the invalidity of the cache and the repeated extraction of this information.
At this point, it seems a little strange that we divided them into separate challenges. I am almost wondering if the input controller should not collect the details as part of the authentication and storage of them. Then Application_OnAuthenticateRequest can only worry about the cache being invalid and user data retransmitted.
Or maybe there is another way to handle this that I donβt even know about.
source share