Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
4.33/5 (2 votes)
Hi All,

I am getting below error message:
"401 - Unauthorized: Access is denied due to invalid credentials"

When i trying to login our website remotly it gives access denied error.
if i changed authentication mode "Windows" in IIS7.5 on our staging server then i can logged into website.
But It is not working if i set authentication mode "Basic".
I want authentication mode "Windows" but when i set windows authentication web site can access remotely but can't access on server network.
please advise me..


Regards,
Sanjay Gade.
Posted
Updated 25-Oct-21 9:04am
v2
Comments
Mario Majčica 10-Jul-12 6:02am    
What's your goal? What kind of authentication you are trying to implement?

Issue solved:
1. Open iis and select the website that is causing the 401
2. Open the “Authentication” property under the “IIS” header
3. Click the “Windows Authentication” item and click “Providers”
4. Move NTLM at top
and BAM that's fixed it.
 
Share this answer
 
Comments
Ahmed M. Gamil 15-Sep-14 4:44am    
I followed the approach in the solution above but the website kept prompting me with a dialogue box that asks for a username and password but whenever I write them in that box it keeps reappearing.. Any ideas ?!
dsacker 29-Sep-15 16:30pm    
A beautiful solution. Interestingly, my production and my development servers had exactly the same provider order, and prod was working while dev was not. I'm not sure whether some group policy, etc., was pushed that broke the dev pass-thru, but this fixed it. Thank you.
mraect 14-Dec-17 8:21am    
I don't have "Windows Authentication" at "Authentication" property.
Solution 7 solve it for me
1. Open IIS and select the website that is causing the 401
2. Open the "Authentication" property under the "IIS" header
3. Right Click the "Anonymous Authentication" item and click "Edit"
4. Select "Application Pool Identity" in popup
5. Click OK
 
Share this answer
 
Comments
marunkumarbe 31-Jan-18 18:14pm    
Worked for me. Thanks
Check if the user has access granted to the folder.
In my case, the trouble was because someone has removed the group SERVER\Users (that contains DOMAIN\Users inside group) from folder.
 
Share this answer
 
SQL
<pre lang="xml">
Step 1] Go to the respective path for example D:\...\Images
Step 2] Open web.config and comment authorization/allow for specific users
</pre>
 
Share this answer
 
Right click on folder and choose Properties.

In Security tab add ‘IUSER’ and 'NETWORK SERVICE' and give full control to both user.
 
Share this answer
 
Another solution to the above error is;
1. Open IIS Manager and select the website that is causing the 401
2. Open the "Authentication" property under the "IIS" header
3. Click the "Windows Authentication" item and click "Advanced Settings" from the right
4. Set "Extended Protection" to "OFF"
 
Share this answer
 
v3

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