Click here to Skip to main content
15,886,780 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys. I have a problem with windows authentication in ASP.NET. Maybe the soludtion is easy but I've stacked in one place and I can't move forward. Let me describe my problem.

Even though I've placed all required configuration in web.config (I think I put all of them).
HTML
<system.web>
  <authentication mode="Windows"/>
  <authorization>
    <deny users"?" />
  </authorization>
</system.web>


What I have tried:

I've also enabled Windows and Anonymous Authentication in IIS. The problem is when I'm trying to log in with my local user (this one on which I'm currently logged in) credentials nothing happens. It looks like my credentials don't work. I'm getting the form to log in every time. I've tried to use username with and without domain name at the beginning but without any effect.

Do you have any suggestion what I've missed or what should I add/change?
Posted
Comments
F-ES Sitecore 13-Jul-16 4:22am    
Windows auth happens automatically, you don't do anything, you don't supply a username or password, it just knows who you are from your logged in user. If you enable anon access then other auth methods won't work as the initial anonymous attempt succeeds so there is no need to query for credentials.
brzydkimech 13-Jul-16 4:48am    
If both windows and anonymous authentication are turn on this is true but as far as I know if we add in web.config inside authorization node <deny users"?"=""> entry, then anonymous users won't be taken under consideration anymore. It means that Windows authentication will be used. But even I turn off anonymous authentication (only windows authentication is turn on) I'm still getting popup with form to log in.
F-ES Sitecore 13-Jul-16 4:51am    
If you're getting the pop-up then it's falling back to Basic Authentication. Is this on an intranet\local network? Windows Auth only works when the IIS server can recognise the client, usually because they are on the same domain etc, Windows Auth won't work over the internet or in a few other circumstances.
brzydkimech 13-Jul-16 4:56am    
I have IIS server,website and SQL server on my local machine so everything works in my local network/environment. What is interesting, when I turn on only Basic Authentication and log in with my credentials (username and password to my machine) then it works.
Richard Deeming 13-Jul-16 7:57am    
Are you accessing the site as http://localhost/..., or are you using the computer name (or a custom host header)?

If it's the latter, you might be running in to the "loopback check" issue:
You receive error 401.1 when you browse a Web site that uses Integrated Authentication and is hosted on IIS 5.1 or a later version[^]

1 solution

Windows authentication in asp.net Part 87 - YouTube[^]

Hi friend above link help to solve your problem
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900