'Windows authentication asking for login and logging in wrong user

I am using windows authentication on an intranet that has been duplicated for two different environments with different servers being accessed. I am using a domain without periods rather than IP so it should log in automatically but it prompts for a login on site 1. On site 2 it prompts for a login, but regardless of which user logs in, WindowsIdentity.GetCurrent().Name always returns my login which was the very first login rather than the current user.

Here is my configuration:

Anonymous authentication: disabled

Windows authentication: enabled

web.config:

<system.web>
    <authentication mode="Windows" />
    <identity impersonate="true" />
    <authorization>
    <deny users="?" />
    </authorization>
</system.web>

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
</system.webServer>   

Why is it prompting for a login and why is one instance logging in properly and the other not?



Solution 1:[1]

Made the mistake of setting a user when the application was created. It is working now.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Justin Lilly