Automatically log into the application using Windows Authentication

Asked

Viewed 267 times

1

I need to automatically log in my ASP.NET application using Windows credentials (Active Directory), exactly the same as the Sharepoint ago.

In Visual Studio already has a template (Framework 4.5) where it creates a Webapplication with Windows Autentication, The example works perfectly on my machine, but if I publish this site on a machine on the network, which is really the domain of my machine, it doesn’t work. It opens the login screen, and it still doesn’t recognize my network user and password. It’s like it doesn’t "see" my domain controller.

By the examples I found on the internet, I just put the following lines in my Web.config:

<authentication mode="Windows" />
<authorization>
  <deny users="?" />
</authorization>

It is also necessary to add the option of Windows Autentication in the IIS.

I have already performed all of these steps, but to no avail. Maybe I have some additional configuration on IIS that is missing for my example to work.

I did a test using my machine as a server and accessing from other machines on the network. Some machines entered without requesting user and password, and some opened the login screen. Would it be some configuration on the client machines? I check in Internet Options and all machines on Security > Authentication of the User, the "Automatic logon only in the intranet zone is checked"

  • I already answered this one: http://answall.com/a/28783/2999

  • If popup appears to enter user / password, the web server is not in the same domain as AD.

  • As I mentioned, I have already made the necessary changes to Web.config, and everything worked perfectly on my machine. However when I deploy to the server, the application cannot login, the login screen is displayed.

  • I did a test using my machine as a server and accessing from other machines on the network. Some machines entered without requesting user and password, and some opened the login screen. Would it be some configuration on the client machines? I check in Internet Options and on all machines in Security -> User Authentication, the option "Automatic login only in the intranet zone"

  • Could you please include this comment above in the question? I will indicate for reopening.

  • @Ciganomorrisonmendez, the reopening should only be started once clarified within the question because you are not a duplicate... You can edit the question yourself to incorporate the new information of Cristiano.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.