473,468 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Login failed for user (null). Not associated with a trusted SQLSe

I know this question has been posted in many places, but I have not been able
to solve our current problem. The developers in my office are all new to
C#.net. We have been developing an application using Visual Studio .NET 2003
and IIS 6 with SQL Server 2000. Up until this point each developer has used
a local copy of IIS and connected to sql server on a remote server without
any problems. Next week we have a demo, and I have tried to deploy our
solution to the IIS(6) on the remote server which also hosts the SQL server
we have been using. Now we all get the 'Login failed for user (null)......'
error message.
The web.config has the following:
<authentication mode="Windows"/>
<identity impersonate="true" />

Integrated Security = SSPI is a part of the connection string.

On the remote server, Sql server is set to use both windows and sql server
authentication
IIS is set for Integrated Windows authentication.
We cannot use active directory and therefore do not have Kerberos enabled.
Any help would be greatly appreciated.

Thanks
Sherri
Apr 15 '07 #1
6 1968
"Sherri" <Sh****@discussions.microsoft.comwrote in message
news:86**********************************@microsof t.com...
we have been using. Now we all get the 'Login failed for user
(null)......'
error message.
The web.config has the following:
<authentication mode="Windows"/>
<identity impersonate="true" />

Integrated Security = SSPI is a part of the connection string.

On the remote server, Sql server is set to use both windows and sql server
authentication
IIS is set for Integrated Windows authentication.
We cannot use active directory and therefore do not have Kerberos enabled.
Any help would be greatly appreciated.
By specifying Integrated Security, you've told ASP.NET to try to connect to
SQL Server with the account that it's currently running under.

You've also told ASP.NET not to run under its default account, but to
impersonate a different account instead.

So, have you set up the account that ASP.NET is impersonating as a valid
user in the SQL Server database that you're trying to connect to...?
Apr 15 '07 #2
Sherri,

If your developers have IIS and SQL installed on the same box the user token
for SSPI will be passed to SQL for the login. If your demo environment has
the IIS and SQL on different boxes this would explain your issue. IIS can
not pass the Windows user token to another machine on the network. The
simplest solution will be to add and SQL server username and password to the
connection string. If you want to use windows authentication and SSPI you
will have to configure Active Directory to pass the Kerberos ticket along to
the next machine for authentication.

Hope this helps.

Kris

"Sherri" <Sh****@discussions.microsoft.comwrote in message
news:86**********************************@microsof t.com...
>I know this question has been posted in many places, but I have not been
able
to solve our current problem. The developers in my office are all new to
C#.net. We have been developing an application using Visual Studio .NET
2003
and IIS 6 with SQL Server 2000. Up until this point each developer has
used
a local copy of IIS and connected to sql server on a remote server without
any problems. Next week we have a demo, and I have tried to deploy our
solution to the IIS(6) on the remote server which also hosts the SQL
server
we have been using. Now we all get the 'Login failed for user
(null)......'
error message.
The web.config has the following:
<authentication mode="Windows"/>
<identity impersonate="true" />

Integrated Security = SSPI is a part of the connection string.

On the remote server, Sql server is set to use both windows and sql server
authentication
IIS is set for Integrated Windows authentication.
We cannot use active directory and therefore do not have Kerberos enabled.
Any help would be greatly appreciated.

Thanks
Sherri

Apr 15 '07 #3
"Kris Lankford" <kn********@hotmail.comwrote in message
news:03**********************************@microsof t.com...
IIS can not pass the Windows user token to another machine on the network.
Are you sure about this...? I'm doing precisely this on my current
project...

1) A new user has been created which has slightly more privileges than the
default user which ASP.NET uses - principally to support writing to
ActiveDirectory...

2) The ASP.NET app impersonates this user - set up in web.config /
aspnet_setreg...

3) SQL Server 2005, configured for integrated security, is running on a
different machine...

4) The new user has been added as a valid login to SQL Server, and granted
sufficient permissions on the databases it needs

5) ASP.NET uses the "SSPI" connection string

Works perfectly...
Apr 15 '07 #4
I'm new to this so I'll answer the best I can. Its my understanding that SQL
Server should be using the user account of the person logged in. There is an
account set up in sql server for this user with permissions to the database.
"Mark Rae" wrote:
"Sherri" <Sh****@discussions.microsoft.comwrote in message
news:86**********************************@microsof t.com...
we have been using. Now we all get the 'Login failed for user
(null)......'
error message.
The web.config has the following:
<authentication mode="Windows"/>
<identity impersonate="true" />

Integrated Security = SSPI is a part of the connection string.

On the remote server, Sql server is set to use both windows and sql server
authentication
IIS is set for Integrated Windows authentication.
We cannot use active directory and therefore do not have Kerberos enabled.
Any help would be greatly appreciated.

By specifying Integrated Security, you've told ASP.NET to try to connect to
SQL Server with the account that it's currently running under.

You've also told ASP.NET not to run under its default account, but to
impersonate a different account instead.

So, have you set up the account that ASP.NET is impersonating as a valid
user in the SQL Server database that you're trying to connect to...?
Apr 16 '07 #5
Sql Server and IIS are installed on the same box for the demo environment.
Is there anyway to do this without Active Directory?

"Kris Lankford" wrote:
Sherri,

If your developers have IIS and SQL installed on the same box the user token
for SSPI will be passed to SQL for the login. If your demo environment has
the IIS and SQL on different boxes this would explain your issue. IIS can
not pass the Windows user token to another machine on the network. The
simplest solution will be to add and SQL server username and password to the
connection string. If you want to use windows authentication and SSPI you
will have to configure Active Directory to pass the Kerberos ticket along to
the next machine for authentication.

Hope this helps.

Kris

"Sherri" <Sh****@discussions.microsoft.comwrote in message
news:86**********************************@microsof t.com...
I know this question has been posted in many places, but I have not been
able
to solve our current problem. The developers in my office are all new to
C#.net. We have been developing an application using Visual Studio .NET
2003
and IIS 6 with SQL Server 2000. Up until this point each developer has
used
a local copy of IIS and connected to sql server on a remote server without
any problems. Next week we have a demo, and I have tried to deploy our
solution to the IIS(6) on the remote server which also hosts the SQL
server
we have been using. Now we all get the 'Login failed for user
(null)......'
error message.
The web.config has the following:
<authentication mode="Windows"/>
<identity impersonate="true" />

Integrated Security = SSPI is a part of the connection string.

On the remote server, Sql server is set to use both windows and sql server
authentication
IIS is set for Integrated Windows authentication.
We cannot use active directory and therefore do not have Kerberos enabled.
Any help would be greatly appreciated.

Thanks
Sherri
Apr 16 '07 #6
"Sherri" <Sh****@discussions.microsoft.comwrote in message
news:EE**********************************@microsof t.com...
I'm new to this so I'll answer the best I can. Its my understanding that
SQL
Server should be using the user account of the person logged in. There is
an
account set up in sql server for this user with permissions to the
database.
1) Interrogate the servervariables collection on any of the aspx pages in
your site, specifically the AUTH_USER or LOGON_USER variables - that will
tell you which user your site is running under. If it's not what you think
it should be, then there's your problem...

2) From SQL Server Management Studio, try to connect to the server in
question by logging in as the user you think your ASP.NET app should be
using... Can you get in? Can you access the database(s) your ASP.NET app
needs to access...? If not, then there's your problem...
Apr 16 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: TBone | last post by:
Anyone, I have a user "john" whose machine is part of the "job" domain. He is trying to establish an odbc connection to an MS SQL 2000 server on the "school" domain. He uses Windows...
1
by: Mark | last post by:
We are using impersonation so that a user on our domain will login into our SQL Server using their own domain login and/or associated domain groups. To do this, we've added: <authentication...
2
by: Frederik | last post by:
Hi, First sorry for my english I'm french. I developped a web app that work good under XPDEVSERVER machine (iis5) and SqlServerDevelopper Edition. I get problem when I moved this app to an...
4
by: rrober07 | last post by:
Hello, My Setup is I have a Web Server machine(Devweb01), Database SQL Machine(Devsql01), a Client Machine(local machine) I have configured the SQL machine as follows: 1) Added local Aspnet...
3
by: Nicola Marchiori | last post by:
Hi I need some help. I am developing a Web App in one PC running IIS. I am trying to connect to to MSDE on another PC, but it's not working. This is the message i got Login failed for user...
4
by: Brett | last post by:
I have an ASP.NET 2.0 application that uses Forms Authentication. The startup page contains just a login control, and the site works well on an IIS 6 web server. I am now setting the site up on...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.