John S
John S

Reputation: 8351

HttpContext.Current.User.Identity is null/empty in view of ASP.Net MVC site on one server but not the other

I have an ASP.Net MVC site that is running on an internal server. A view on the site uses @HttpContext.Current.User.Identity.Name to display the name of the user accessing the site via browser. The Authentication mode is set to Windows.

When run on one of our servers it works as expected. When the same code is run on a second server the whole Identity object appears to be empty. This second server is a bit more isolated via firewall compared to the first server.

What sort of rules could be preventing the Identity object from being filled?

In the web.config I also have

<authorization> <deny users="?" /> </authorization>

Which should prevent any anonymous users from accessing the site. Since I am able to view the site I assume that it sees that I am authorized.

Upvotes: 1

Views: 2101

Answers (1)

John S
John S

Reputation: 8351

Anonymous and Windows authentication were both turned on. Needed to turn off Anonymous.

Upvotes: 1

Related Questions