.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

Website Windows Authentication fails when enabling SQL Mixed Mode.

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

Hello all,

Just to describe the scenario. I have a website. This lives on a webserver. On that webserver is an SQL server. The website connects to this database using windows authentication. I have written a windows form application that connects to the SQL Server on the webserver. This application is being run from a location on out intranet. The Winform application use SQL authentication to connect to the database. The SQL Server didn't have mix mode authentication enabled. So I enabled it. The winform application could now connect to the SQL Server.

This is where it starts getting a little strange.

The Website that was already connecting find using integrated authentication starts failing with:

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

When you are enabling mixed mode authentication, you are adding another authentication method, why would the original Windows authentication fail?

Thanks for any suggestions and sorry if this is completely the wrong place to be asking this question,


View Complete Post

More Related Resource Links

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

SSRS 2005 "Mixed" Authentication Mode


I have a web application where users can authenticate using either SiteMinder or Windows domain accounts.  This is actually configured as two separate virtual directories within IIS 6.  Both applications need to use the same instance of SSRS.  Is it possible to configure the SSRS web application so that if a user is authenticated by SiteMinder it impersonates a Windows account, but if they are already Windows-authenticated that account is used instead?

SQL changes from Mixed to Windows auth mode after SQL updates

We run a SQL 2005 cluster on Windows 2008 in Mixed authentication mode.  The last two times we have applied a SQL security patch, it automatically changed the auth mode from Mixed to Windows-only, taking our applications offline.  Most recently was today, when we applied KB970892. Can someone explain why this is happening and how we can prevent it?

Enabling Windows Authentication to SQL Server using Application Pool Credentials

I have created a WCF Service (VS2008), an application pool account which has the access to the SQL Server(in remote machine). Configured the App Pool account to the Virtual Directory in IIS (Version 6.0). Once I browse through the SVC file, I can see the WSDL file. I have the "Windows Authentication" and the 'Anonymous authentication" Checked in the Properties for the Virtual Directory. But when I access service through Client, I get "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.". Binding that is being used is HTTPBinding. I have set the Identity Impersonate to True as well. Bottom line is - I need to use the App Pool account to connect to the SQL Server. Could some one please help me in this?  

mixed mode authentication


I'm trying to build the mixed authentication and have the following problem:

I have a sub application of main application. The main application has the forms authentication enabled and sub- application has windows authentication enabled.

When I start debugging in main application I get nothing and when I start debugging from sub application (name = WinLogin) - after string user = Request.ServerVariables["LOGON_USER"];


FormsAuthentication.RedirectFromLoginPage(user, true);

I'm redirected to   /Wholesale/WinLogin/Admin/Order.aspx instead of  /Wholesale/Admin/Order..

<authentication mode="Forms">

SQL 2008 - Switching to Windows Authentication Mode


I'm thinking of switching to Windows Authentication on my SQL 2008 server.  Here's my first draft at a plan:

1.  Create Windows accounts matching the exiting SQL accounts.
2.  Grant the new Windows accounts the appropriate database permissions.
3.  Change applications to use the new account information.
4.  Remove the SQL accounts
5.  Switch SQL to Windows Authentication

Is is that simple?  Or am I missing something?

Mixed Authentication Using IIS 7 On Windows Server 2008


Hi Mike,
I have read your workaround for mixed authentication mode, and it works fine here on my own solution when i tried it, but my scenario for mixed authentication mode is a little bit different, it was working fine on IIS 6.0 ,but when i tried it on IIS 7 it didn't work.
My Secuirty settings for the app as follows:
- am using forms authentication and my login page called "Login.aspx".
- am using your custom module called "Mvolo.FormsAuthenticati

Mixed mode authentication in sharepint 2010



Is it possible I have two mixed FBA in sharepiont 2010? For example, one custom membershipprovider reads data from Database1, the other custom membershipprovider reads from Database2?

Thank you



Website converts to windows authentication issue


I've been having an occasional issue with my website "converting" to site that requires windows authentication.  This happens every few months and the only way to fix it to recycle the application pool.

This issue is actually happening with a hosting company and my site is on a shared server.  I believe I have my own application pool and I'm able to recycle it myself using their web administration tools.  Fortunately,  I know how to fix and have the ability to do it myself but it is embarrassing when my site now longer works and I have a client email there is a problem.

Anybody have any ideas?  I'm running .NET 3.5 with latest SP.  Thanks!

Using Active Directory Authentication when Windows Authentication fails


I have a web application (intranet based) which uses Windows Authentication.  Unfortunately there are public computers that have public logins at some company locations.  My web app doesn't support these public logins because I need to know the user working with the app.

So, even though these public users are windows authentication users, my app will fail because I have no user account setup for that particular account.  I want to then try Active Directory Authentication.

In my Default.aspx.cs I'd have something like this:

  protected void Page_Load(object sender, EventArgs e)
    userContext = new UserContext(); // If the authenticated user isn't a user in my system then throw an exception
   catch (UILayerException)
          // This I where I want to now do Active Directory Authentication
          // Maybe I redirect to a login page or what?
          // But remember the user IS authenticated even if they aren't a user in my system so I need to do something about that.

Re-login to SQL Server 2008 in Windows authentication mode after resetting my Windows login password



I recently reset my Windows login password but from then onwards SQL Server 2008 is not allowing me to login in Windows authentication mode.

Can someone please help on where I can go and set my new Windows Login password in SQL Server 2008 and continue to login in Windows authentication mode?

Thank you,

Anish Ravindran

Tomcat Windows Integrated Authentication fails with More than 1 Web Application


Hi all,

I’m using Tomcat 5.5.23 on a Windows server 2003 (64 bit).

Tomcat runs as a window service, using an Active Directory account.

DB is configured to Windows Authentication mode alone.


Tomcat contains 2 web applications.

The DLL’s (sqljdbc_auth.dll) location is the value of Tomcat’s –Djava.library.path parameter.



The container loads, the first web application loads and successfully establishes a connection to the DB,

But the second web application fails to connect to DB, prompting:

 com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.



When loading tomcat with only a single web application (either one), the web application successfully connect to the DB.

This is why I don’t think the reason is at web.xml.


Any idea?


Thanks, Itamar

Tomcat Windows Integrated Authentication fails with More than 1 Web Application


please check related topic in SqlDataAccess forum.


Thanks, Itamar

Web Matrix + Windows Authentication


I'm curious if its possible to get windows auth working with asp.net webpages/webmatrix.

I've got it published to IIS with windows auth turned on and anonymous/forms/basic turned off.

I'm guessing the WebSecurity Helper probably won't work here but can you access User.Identity.Name etc?

Sorry for the newbie questions, I've only just started working with asp.net ^^,

Windows Authentication for IIS in Windows 7 Home Premium Edition - for ASP Websites.


How to create a virtual directory and get benefit of the IIS. Is there a workaround to accomplish this without the Windows Authentication for Windows 7 Home Premium Edition?

Thanks in advance, 

Using windows authentication to access SQL when using ASP.NET 4.0 via COM+


I am using SQL Server 2008 under windows authentication, front end is ASP.NET which uses COM+ to access database.

COM+ components are configured to run as domain user.

When looking through the logs (SQL Profiler), I can see the login name as the configured identity instead of windows indentity.

I have got Website running under "Intergrated Windows Authentication" and database is running locally on webserver.

Web configure contains entry for <identity impersonate="true"/>.

My connection string is

connectionString="data source=db01\test01;initial catalog=test; integrated security=SSPI;persist security info=False; Trusted_Connection=Yes"

Any ideas?




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