Accessing SQL server using ASP .NET

S

Stephen

Hi,

I have written a sample ASP .NET application to connect to a SQL Server box
that uses Windows authentication ( i guess it was installed by the server
guys that way). In my web.config page I have used these configuration
parameters
<authentication mode="Windows" />
<identity impersonate="true"/>

<authorization>
<allow users="*" />

<appSettings>
<add key="SQL_DB_CONNECTION" value="SQL123" initial
catalog=Sample;integrated security=SSPI;persist security info=False;
Trusted_Connection=Yes" />

</appSettings>

Now when I run the application it gives me an Connection/Configuration Error
authorization failed for "NT\anonymous" user... why?

I went to IIS and for the application and removed the "anoymous access
login" and the application works....

How can I make the application accessible by anonymous users?

thanks,
Stephen.
 
C

Curt_C [MVP]

you'll have to assign the user in IIS as a valid SQL/Domain user, and not
the IUSR account
 
B

bruce barker

in the web config, see the <impersonate> settings. set a userName and
password. note: asp.net supports using encrypted registery values for
security.

-- bruce (sqlwork.com)

| Hi,
|
| I have written a sample ASP .NET application to connect to a SQL Server
box
| that uses Windows authentication ( i guess it was installed by the server
| guys that way). In my web.config page I have used these configuration
| parameters
| <authentication mode="Windows" />
| <identity impersonate="true"/>
|
| <authorization>
| <allow users="*" />
|
| <appSettings>
| <add key="SQL_DB_CONNECTION" value="SQL123" initial
| catalog=Sample;integrated security=SSPI;persist security info=False;
| Trusted_Connection=Yes" />
|
| </appSettings>
|
| Now when I run the application it gives me an Connection/Configuration
Error
| authorization failed for "NT\anonymous" user... why?
|
| I went to IIS and for the application and removed the "anoymous access
| login" and the application works....
|
| How can I make the application accessible by anonymous users?
|
| thanks,
| Stephen.
|
|
 
G

Guest

If you are running IIS 6, you can create an application pool and set the
identity to a user that has access rights to the sql server. Then put your
asp.net application into that application pool.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top