Tuesday, March 27, 2012

Login failed for user (null). Reason: Not associated vs asp.net

ASP.NET vs SQL Server

I have an ASP.NET Application
In IIS I checked the Integrated Windows Authentication
option

In Web.Config the connection string include Integrated
Security = SSPI
and Impersonate=true in Web.Config

When I start then Web Application I have this messge
Login failed for user '(null)'. Reason: Not associated
with a trusted SQL Server connection.
Could you help me

PS My account have the permission to connect to SQl Server

the security model is base on role security
I have many users"rl30" <rl30@.hotmail.com> wrote in message
news:%23GQRAX3YDHA.3768@.tk2msftngp13.phx.gbl...
> ASP.NET vs SQL Server

That's definately what it feels like sometimes.

> In Web.Config the connection string include Integrated
> Security = SSPI
> and Impersonate=true in Web.Config
> When I start then Web Application I have this messge
> Login failed for user '(null)'. Reason: Not associated
> with a trusted SQL Server connection.

You probably need to allow the IUSR_<serverName> user access to the
database. If you turn on impersonation in ASP.NET without specifying what
user to impersonate, I believe it defaults to impersonating the IIS
anonymous logon user, which is IUSR_<serverName> by default. Everyone
visiting the website will impersonate as IUSR_<serverName> (instead of the
default ASPNET user).

> the security model is base on role security
> I have many users

Do you want forms authentication integrated with Active Directory users? If
so, that becomes a little more complex than simply turning on Impersonation
in the Web.Config file. The web.config file only gives you the ability to
impersonate everyone as 1 single user.

0 comments:

Post a Comment