I'm working on an ASP.NET project, and we're attempting to switch from SQL Server authentication to Windows authentication to connect to the database.
It works fine locally when I debug in Visual Studio, but when it hits the web server, I get the error: "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."
IIS has anonymous access disabled, and Integrated Windows Authentication is checked. The web.config file has:
<authentication mode="Windows"/>
<identity impersonate="true"/>
The database I'm attempting to access is on a different machine than IIS, and the connection string doesn't contain a username or password, and has "Trusted_Connection=Yes", and "Integrated Security=SSPI".
From what I've been able to find online, I'm guessing the problem is due to IIS and SQL Server residing on different machines, but I'm not sure how to fix it.
Any ideas?
You might find this blog post fromranganh to be helpful:You may receive the error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection" - Part II|||Correct me if I'm wrong, but won't the solution in that blog preventSQL Server from differentiating between different Windows users?
I need to actually pass the Windows user information to SQL, asdifferent users have different permissions to certain stored procedures.|||A follow-up:
I read this article:
http://www.awprofessional.com/articles/article.asp?p=350387&rl=1
As per its advice, I checked the web server in Active Directory, andenabled it for delegation. We're waiting for the changes to propegate,but maybe this will solve the problem.
No comments:
Post a Comment