.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

IIS7 anonymous authentication issues (401 Unauthorized Error)

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :ASP.Net

I am trying to get anonymous access to my asp.net MVC web application.  My application pool is running as 'Network Service' adn I have given this account full access to my website root folder.  I have also enabled Anonymous Authentication within IIS for my website.  I have also given the 'IUSR' account full control of my website root folder (I understand that IIS runs as this account with anonymous access). 

What am I missing?  I continuously get the following 401 ERROR :

HTTP Error 401.0 - Unauthorized

You do not have permission to view this directory or page.

  • The authenticated user does not have access to a resource needed to process the request.
Logon Method  Anonymous
Logon User Anonymous
Module ManagedPipelineHandler
Notification ExecuteRequestHandler
Handler UrlRoutingHandler
Error Code


View Complete Post

More Related Resource Links

The HTTP request is unauthorized with client authentication scheme 'Anonymous'

I am trying to do a soap request from a WebCTRL server. I went to add a service reference, entered the URL to my wsdl and (after prompting me for a username and password) it added the reference and I can create an instance of the service object and makes calls against it.   Dim eval As New WebCTRL_Eval.EvalClient eval.Open() Debug.Print(eval.getValue("#reception_40/lstat"))   I get this back from the server, on open and getvalue.   The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="SOAP Access"'.   I understand that it is the HTTP authentication that I need to setup or configure, but just dont understand how to do it.   I have tried eval.ClientCredentials.UserName.UserName = "myusername" eval.ClientCredentials.UserName.Password = "mypassword"   How do I change the client authentication scheme and provide my credentials to it?   Here is what is on my app.config file.   <system.serviceModel>  <bindings>   <wsHttpBinding>    <binding name="EvalSoapBinding"     bypassProxyOnLocal="false"     transactionFlow="false"     hostNameComparisonMode="StrongWildcard"     maxBufferPoolSize="524288"     maxReceivedMessageSize="65536"     messageEncoding="Text"

The HTTP request is unauthorized with client authentication scheme 'Anonymous'.




I am receiving an error when i am callign the WCF service which is hosted in the IIS,


The HTTP request is unauthorized with client authentication scheme 'Anonymous'.The authentication header received from the server was 'Negotiate,NTLM' while calling service hosted in IIS.


Both check boxes are checkd in the properties->DirectorySecurity->Edit...

Anonymus and Integrated Windows.


Can anybody help me regarding thsi issue...






The HTTP request is unauthorized with client authentication scheme 'Anonymous' The authentication


Hi all,

The scenario is as follows.

I need to connect to a webservice hosten in a JBOSS server.

The server provides a certificate, besides it requires username and password to validate against an LDAP.

My part is to develop a client in .NET WCF that uses the constraints defined above.

Here is my client code:


service.ServiceModificarDomicilioContactoPersonasClient servicioJboss = new service.ServiceModificarDomicilioContactoPersonasClient();

service.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

service.ClientCredentials.UserName.Password = "******";
service.ClientCredentials.UserName.UserName = "******";

service.ClientCredentials.Windows.ClientCredential.UserName = "********";
service.ClientCredentials.Windows.ClientCredential.Password = "********";

service.modificarDomicilioResponse resp = new service.modificarDomicilioResponse();
service.modificarDomicilio metodo = new service.modificarDomicilio();
metodo.arg0 = 1;

metodo.arg1 = 1402251;

metodo.arg2 = 506907;

metodo.arg3 = 1;

metodo.arg4 = 999999;

Anonymous Web Site receives "The request failed with HTTP status 401: Unauthorized"


I set up a test website on my local box and was able to access sharepoint search using the querySearch web service from SP.  After I got it all working properly I transferred the code to the target website that is set up with anonymous access for all people on the fab floor.  However from this website I keep getting the 401 error.  It can't be SP because the same code worked from my local website "localhost".  Any suggestions?  we don't want to have to have the fab people log in so we can't not have the box anonymous.  I would appreciate any suggestions very much!!!

Using WSS 2007 with MOSS.


  private void GetDefaultCredentials()
      m_where = "get configuration data for credentials";
      string userid = ConfigurationManager.AppSettings[ "userid" ];
      string password = ConfigurationManager.AppSettings[ "password" ];
      string domain = ConfigurationManager.AppSettings[ "domain" ];

      m_where = "set search query credentials";
      m_query.Credentials = new NetworkCredential ( userid, password

MVC 1 - Issues with the homepage - IIS7


Has anyone ever had strange behaviour with deployed MVC websites on IIS7.

Our homepage shows intermittent strange behaviour as follows

1 - Postbacks sometimes are not processed server side, sometimes postbacks change the URL and add random query string parameteres

2 - Server side code in the Index Action is sometimes not called when the homepage loads (we have some data we load in from a cookie on the Index action of Home Controller, intermittently this data is not loaded in.

3 - Tracking - We have a really strange issue whereby some people who hit or site on the homepage are being tracked by Google Anayltics, Our internal tracking database (which uses a cookie) and some other third party software as bounces and then the second page they hit is being logged.

It seems as if randomly, server side code is not being executed from our homepage only. All other pages are fine, this only ever happens on our homepage

Are there issues around MVC homepages in IIS7 - has anyone else ever seen this behaviour ?

[SSRS 2008 R2]Report Builder Access error-The remote server returned an error: (401) Unauthorized.

Hello,        I am able to login Web Service URL and report manager using computer name and report builder is also working fine.  http://RPTSRV/reportserver   (RPTSRV is report server name. web service url working fine. all accessible) http://RPTSRV/reports  (report manager working fine and all accessible ,report builder too) It means I am able to access everything locally right? http://rs.test.abc.com/reportserver  (web service url working fine. all accessible)  http://rs.test.abc.com/reports    (Report manager working fine and all accessible accept report builder)(I carefully checked the link and its taking rs.test.abc.com/reportserver.....)     when I click on reportbuilder button in report manager it shows me error dialog box with following error log!! I tried from local and remote computer too but gives the same error both side. I am not sure but I am just thinking is this double hop kerberos security issue? Please help me to solve this problem. I am finding solution from last 4 days. Reporting Service configuratin tool settings Web Serivice URL -  all set to default Report Manager URL - all set to default Environment - Distributed deployment Server1(report_srv) --Windows server 2003, Installed sql server 2008R2 reporting service,

authentication issues using exchange web service within sql CLR functions

Hi Hope this is the right forum for this question, we have a VB assembly we have written to perform simple email functions via calls to EWS. We use a high level user who has rights to impersonate the normal exchange users, and this usually works OK, but what we are seeing is that occasional email messages are being created in the wrong user's draft folders. We belive this is because the impersonating account information is getting overwritten within our code when multiple users access the functions at the same time Example call to the WS is... <Microsoft.SqlServer.Server.SqlProcedure()> _ Public Shared Sub InsertEmail( _ ByVal Impersonate As String, _ ByVal Subject As String, _ ByVal Body As String, _ ByVal ToAddress As String, _ ByVal CCAddress As String, _ ByVal BCCAddress As String, _ ByVal HTMLEmail As Boolean, _ <Out()> ByRef ItemID As String, _ <Out()> ByRef ChangeKey As String) 'ByVal CCAddress As String, _ 'ByVal BCCAdddress As String, _ Using esb As Helper = New Helper(Impersonate) ' Create the CreateItem request. Dim createEmailRequest As New ews.CreateItemType() ' Specifiy how the e-mail will be handled. createEmailRequest.MessageDisposition = ews.MessageDispositionType.SaveOnly createEmailRequest.MessageDispositionSpecified

Solved: LDAP authentication: error code 49 - 80090308, comment: AcceptSecurityContext error, data 52

Hi, I have a problem conneting to another domain (far.away.domain). We have a two-way trust to this domain. Also I can access the DS using ADSI edit and our Administrator account (ourdomain.com). I tried several types of credentials (userid = "CN=Administrator,CN=Users,DC=ourdomain,DC=com", "Administrator @ ourdomain.com" (without blanks)...). Connecting to ourdomain.com is no problem, but to far.away.domain I can't connect, I always get the error 525 (user not found). What could be the problem? Have I to use an entry from the ForeignSecurityPrincipals CN of the far.away.domain? I also tried to connect using Softerra LDAPBrowser and a command line ldapsearch without succes and with not a better error message. But why is it not possible to use a trusted account, or is this a active directory feature and does not work with pure LDAP bindings? Best regards, Nils.

WCF REST webservice authentication error when hosted with godaddy

Hi guys, I'm currently hosting my site on a shared windows hosting box with Godaddy. I have upgraded my hosting account to .NET 3.5 and having IIS7 as well which is in integrated pipeline mode. I recently build a simple WCF web service using the REST started kit preview 2. Once i uploaded it to the server, I am getting this error"IIS specified authentication schemes 'Basic, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used." You can see it here:http://sawasdeethaiart.com/service.svcThe obvious fix for as i have read from various websites, is to make sure I configure my IIS to have either Basic or Anonymous specification enabled. But as i am on a shared hosting account, i dont have any access to do this. (I have checked all my options in the IIS hosting panel, but there is no option). I am also done this in my web.config<authentication mode="None"></authentication> Is there any other option I can add  to my web.config to overcome this? or is there any other fix for this? Any help will be greatly appreciated. Thanks,Mark  

Error occurred in deployment step 'Retract Solution': Attempted to perform an unauthorized operati

Hi, Is there any reason why I got the error above in my dev machine? It works perfectly fine if I login using the service account. So permission do I need for a regular account? Thanks in advance.

Authentication Providers button greyed out. Trying to turn on anonymous access

Please can you assist. I am trying to enable anonymous access. Tutorials point me to: 'Central Admin > Site Actions > Site Settings > Application Management > Manage web applications > Sharepoint - 80' I should then click on 'Authentication Providers'. This button is greyed out. I am running in dev on windows 7 64bit. Thanks.

sqlcmd - linkedserver - ALL queries fails after FIRST error from remote server - ANONYMOUS LOGON

Hello, I have very strange problem with sqlcmd , it stop working after first error returned from remote sql server (like permission denied), lets try show what I'm doing, configuration is quite simple C- client (windows 2003 x64, standalone sqlcmd client sp3) S1 - server1(windows 2003 x64, sql 2005 sp3) S2 - server2 (windows 2003 x64, sql 2005 sp3) I need connect via middle Linked Server (S1) from C to to S2, each machines have the same LOCAL Windows account C\LSUser, S1\LSUser, S2\LSUser with the same password, LSUser is not domain account, linked server is configured for Windows Account Impersonation (checked Impersonate) Example, query executed from client C: 1>exec [LS1].[DB].[dbo ].[ListTab1]; - works well, no problem 1>exec [LS1].[DB].[dbo ].[ListTab2]; - works well, no problem ok , now try modify permission on S2, I explicitly deny execute procedure [DB].[dbo ].[ListTab1] on S2 to S2\LSUser, 1>exec [LS1].[DB].[dbo ].[ListTab1]; Msg 229, Level 14, State 5, Server S2, Procedure ListTab1, Line 1 The EXECUTE permission was denied on the object 'ListTab1', database 'DB', schema 'dbo'. expected message :), but look now: 1> exec [LS1].[DB].[dbo ].[ListTab2]; Msg 18456, Level 14, State 1, Server S2, Line 1 Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. all remote queries STOP working from client C 1> select top 10 * from [L

SharePoint 2010 Claims Based Authentication - anonymous site is prompting for CBA auth when opening

Hi, I have CBA setup successfully on my sites.  One site is setup for anonymous access and I have disabled "client integration" on that web application. I have a list of MS Office documents on a wiki.  When I click on one I am asked to either save or open or cancel.  Saving works fine but when I choose open, it launches the associated MS Office app.  I am then prompted for a login from CBA.  I can click cancel and the logon screen appears again.  After clicking cancel the 2nd time the document appears in the MS Office app, Word in this case. My question is how do I prevent my users from being prompted for a CBA login when clicking on these files and opening them in the native app on their machine?      --TR

Authentication issues when moving to IIS 7

I am having a strange authentication issue moving sites from IIS 6 to 7. I am still very new to IIS 7 and have not been able to find a reason for this. The site is running with form authentication and windows authentication enabled and anonymous disabled just as it was in IIS 6. I did not find any useful posts here or on the IIS site, so I am hoping someone might know the answer to this. When accessing the site I can get to any page on the first level of directories just fine, whether its protected by by forms authentication or if all authenticated users have access, IE http://mysite/directory1. But if i try to access any subdirectories I always get sent to the page listed in the web.config for the loginURL even on pages that are not protected, IE http://mysite/directory1/subdirectory. If I turn off forms authentication I can access the public pages just fine but the protected pages throw up a windows login prompt. So the issue seems to be with the forms authentication in IIS 7. Has anyone encountered this behavior when transitioning .net sites to IIS 7 or have a possible resolution for this? Any help is appreciated.

SQL Server 2008 Windows Authentication Mode fails for Database Engine, error 18456

I installed SQL Server 2008 Developer Edition (10.0.1600.22.080709-1414) on a Windows Vista 32-bit development machine with Windows Authentication Mode only (no SQL Server Authentication).   Since this is a development machine, I saw no need for Mixed Mode when I did the install.  The SQL Server Management Studio allows me to login to Analysis Services, Integration Services, Reporting Services, BUT NOT the Database Engine!Windows Authentication for the Database Engine gives the following error: EventID: 18456Login failed for user MYDOMAIN\MYLOGIN'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: <local machine>]The 'fix' I have found online is to login as SA in SQL Server Authentication mode & add MYDOMAIN\MYLOGIN as a administrator for the Database Engine.  Unfortunately, I can't since I didn't install SQL Server Authentication mode (only Windows Authentication Mode).  It appears my only recourse is to uninstall, then reinstall in Mixed mode, then to login as SA in SQL Server Authentication mode & add MYDOMAIN\MYLOGIN as a administrator for the Database Engine. Before I do so, does anyone know of a better approach?Scott D Duncan

MVC doesn't work once is published in the WEB, "Error 404 Page Not Found" vs2010 iis7 mvc 2rc2 I up


Hi Everyone.

 I'm doing the samething in my two differents pc.

1) Windows 7,  vs2010 rc, mvc 2rc2, .Net 3.5

2) Winodws xp, vs2008, mvc 2rc2, .Net 3.5

My Hosting is in GOdaddy IIS 7, .Net 3.5.

I created a new project in both computers, i build it, i copied the 3 dll's files in the bin folder (System.Web.Mvc,  System.Web.Routing, system.Web.Abstractions), and i publish them...., i go to my website (www.luisbragagnolo) both same problem "Page Not Found"

 I tried many blogs...many advices...nothing yet....

 Any other new Advice people? Thankssssssss

SQL Server Authentication Error



I have installed sql server 2000 and sql server 2005 in windows XP. In a Sql server 2000 enterprise manager, it shows two groups. The first one is local machine (Windows NT) and the second one is SQLEXPRESS (Windows NT).

I successfully set sql server and windows authentication by clicking Local (windows NT) properties and then security, but I can't able to set SQL Server and windows Authentication in SQLEXPRESS. It display message connection failed check SQL SERVER Registration Properties.

Morever When I used to set SQL  Server & windows Authentication mode using SQL Server 2005 Management studio, it sets perfectly but when i fire a query just to know the version of sql server 2005 , it shows 

"Microsoft SQL Server  2000 - 8.00.194 (Intel X86)   Aug  6 2000 00:57:48   Copyright (c) 1988-2000 Microsoft Corporation  Desktop Engine on Windows NT 5.1 (Build 2600: Service Pack 3) "

So in this case I can't able to restore my previous database that has been previously developed in sql server 2005.


Kindly help in this matter..




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend