I'm setting up a web service that is only supposed to work for users in a certain Active Directory. Unfortunately I'm encountering error 401 - Unauthorized.
Things I've tried:
I initially tried configuring IIS and the web.config file to grant access to the users in the Active Directory but I couldn't get this to work.
Next I decided to take a step back and configure IIS and the web.config file to grant access to all users. This too, surprisingly, does not work.
What happens when I call the web service:
When I call the web service I immediately get the error 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." I didn't get a pop up asking for any credentials, so let me know if that's an issue.
Relevant Settings in IIS:
- Anonymous Authentication is Disabled
- Windows Authentication is Enabled
- Authorization Rules is set up to Allow All Users
--
Here are the relevant lines of code in my web.config file:
<system.webServer>
...
<security>
<authorization>
<remove users="*" roles="" verbs="" />
<add accessType="Allow" users="*" />
</authorization>
</security>
</system.webServer>
You can see from the code that I allow access to all users (users="*"), but this is still giving me the 401 error.
Thank you for your help.