Re: perplexing SQL authentication from ASP.net issue

From: bruce barker (nospam_brubar@safeco.com)
Date: 09/13/02


From: "bruce barker" <nospam_brubar@safeco.com>
Date: Fri, 13 Sep 2002 10:49:20 -0700


you can not use TrustedConnection in this senario. if windows authentication
is used, the sql must be local or sql standard secuirty must be used. this
is because nt will not forward windows creditionals. you must use digest or
basic security to use trusted connections to a remote sql server.

-- bruce (sqlwork.com)

"Robert Brown" <robert.n.brown@treasury.sungard.com> wrote in message
news:ebe7b3f6.0209130416.7d702d3@posting.google.com...
> Hi all,
>
> Apologies for the cross-post, I cant really tell what's the issue
> here...
>
> I'm developing an asp.net intranet application using VS.net. The IIS
> directory security is set to Integrated Windows Authentication only.
> The dataserver (MS SQL 7) is on a separate machine to the IIS server,
> but in the same domain. MS SQL is set to accept both Windows and SQL
> authentication. I'm trying to use Windows authentication.
>
> My NT user ID has permission on the database.
>
> The problem is, when my asp.net app attempts to log into the database
> I get the following error:
>
> Login failed for user '(null)'. Reason: Not associated with a trusted
> SQL Server connection.
>
> I've tried a variety of connection strings. I keep the connection
> string in the Web.config file. I started out using the same
> connection string that VS.net uses. I ripped it out of a
> sqlConnection object:
>
> data source=xxx212;initial catalog=Test;integrated
> security=SSPI;persist security info=False;workstation id=xxx210;packet
> size=4096
>
> I'm able to connect fine from VS.Net (which is installed on the web
> server) using this string.
>
> I then built a connection string from a blank .udl file:
>
> Integrated Security=SSPI;Persist Security Info=False;Initial
> Catalog=Test;Data Source=xxx212
>
> Still no go. I added a Trusted_Connection=yes. No good.
> Trusted_Connection=true. No good.
>
> I know that it should work because I have a classic asp page that
> works perfectly:
> --------------------------------------------------
> dim dbc
> Set dbc = Server.CreateObject("ADODB.Connection")
>
> dbc.Open("DSN=QuantumSQL;SERVER=xxx212;DATABASE=Test;")
> --------------------------------------------------
>
> I have this page in the same directory as my ASP.net. Connects to the
> same dataserver with no problem. I tried this connection in my
> ASP.net app, but I got another message:
>
> Unknown connection option in connection string: dsn.
>
> ...which I haven't pursued.
>
> When I run my old asp server variables page, I can see that AUTH_USER
> is my NT DOMAIN\uid, and AUTH_TYPE is Negotiate.
>
> Can anyone please help out on this? Much appreciated....
>
>
> Thanks,
>
>
> Rob



Relevant Pages

  • Re: SQL Server uses Windows authentication
    ... > With Windows Authentication you do not put any credentials in the ... The connection uses the credentials of whatever ... >> 1 remote web server to connect to an SQL db on a completely different ...
    (microsoft.public.inetserver.asp.db)
  • Re: Login failed for user . The user is not associated with a trusted SQL Server connection.
    ... want to connect to an SQL 2005 server running on Windows 2003. ... If I use SQL authentication, ... windows authentication it gives the above error. ... server with that, it reports that the test connection is successful, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP / SQLServer connection
    ... Your connection string uses SQL authentication but the error message looks ... Did you specify SQL ... authentication or Windows authentication in your ODBC setup? ...
    (microsoft.public.inetserver.asp.general)
  • Re: ASP / SQLServer connection
    ... Your connection string uses SQL authentication but the error message looks ... Did you specify SQL ... authentication or Windows authentication in your ODBC setup? ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL.Net connection in VS2005 from local IIS to local SQLExpres
    ... my connection string is: ... SQL2005 server name is LANDON\SQLEXPRESS ... I can log into SQL Server 2005 and look at the tables. ...
    (microsoft.public.sqlserver.connect)