asp.net app accessing my SQLSERVER DB using windows authentication

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi

My web page is accessing a SQL DB to display some data. It works fine using
login/password security on the sql server database, but I'm trying to use
WIndows authenication and I get the message


Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.


My Connectionstring
connectionstring = "packet size=4096;integrated security=SSPI" _

& ";data source=" & theserver.Text & ";persist security info=false;initial
catalog=msdb"



My IIS server project has anonymous login and integrated windows
authenication checked.



Thanks

Paul
 
Paul,

You need to do two things:

In your web.config file insert the tag:

<identity impersonate="true" />

(place it just under the tag:
<authentication mode="Windows" />

This will cause the web app to run as the anonymous web account:
iusr_[MachineName].

If you want (and it's recommended) you can create a new user account just
for your app and then set the web site's anonymous account in IIS to run
under that user account.

Whether you create an account or stick with the iusr account you then need
to add that account the the sql server users and give it permissions to your
stored procedures (or any other access it needs) in the database.

I hope this helps,
--
S. Justin Gengo, MCP
Web Developer


Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Back
Top