0
I have a website that uses the user logged into the computer to validate what functionality he will have access to within the site. To capture the user logged into the machine I am using the code below, I needed to change the authentication of IIS for Windows Authentication, but it keeps requesting user and password when accessing the site for the first time.
string userNameWindows = this.Context.Request.LogonUserIdentity.Name;
How do I capture the logged-in user on the machine without requesting login/password on first access.
Felipe, I tried to use the methods you suggested but I was unsuccessful. If I use the Forms Authentication message : 401 - Unauthorized: Access is denied due to invalid credentials. You do not have permission to view this directory or page using the credentials that you supplied. When using the other method it still asks Login/Password on the first access, and should capture the user logged in the machine.
– Victor Augusto
Victor, I did a search and found some points to analyze: * Check to see if anonymous IIS access authentication is disabled. * Web server must be in the same network domain of the client machine, if not, there must be a trust between the servers for this authentication delegation. * Check if browser settings allow auto-logon: Tools > Internet options > Security(Tab) > Custom Level(button) > Login > Auto-logon with current username and password.
– Felipe Grossi
Felipe thank you so much, I finally got it. . The IIS settings were correct, what was impacting the problem were the browser settings that requested login and password when entering the Site.
– Victor Augusto