1

Context.User is null (or HttpContext.Current.User) in Application_AuthenticateRequest() method in my MVC project that uses Windows authentication using MySql membership.

any idea?

protected void Application_AuthenticateRequest()
        {
            var us = Context.User;
            var user = HttpContext.Current.User;

        }
Pingpong
  • 7,681
  • 21
  • 83
  • 209

1 Answers1

3

Most likely it is because the Application pool in which the MVC application is running has pipeline mode set to Integrated. If you set to classic it should work fine. Some explanations, discussion and links here:

HttpContext.Current.User is null even though Windows Authentication is on

Community
  • 1
  • 1
j0aqu1n
  • 1,013
  • 7
  • 14