Monday, March 12, 2012

Integrated Auth and SQL servers

I'm building a reporting server that will grab data off of a an old HP3000, all of that is being done in a background task (non asp.net) and uploaded to an sql server.

I'm using a web interface to allow people within the company to view the data. This will be in a single domain, behind a firewall, and will not be accessable from outside of the company.

In IIS, I have anonymous login unchecked and only Integrated Windows Auth checked. The pertinate parts of my web.config look like this:

<authenticationmode="Windows"/>

<identityimpersonate="true"/>

<authorization>

<allowusers="*"/>

<denyusers="?"/>

</authorization>

My connection string looks like this:

publicstaticstring SqlServerConnect = "Integrated Security=SSPI;Initial Catalog=[name of database];Data Source=[sqlserver IP]";

The website (for now) is on my local development computer. When I run the program everything works fine, when I attempt to view the web page on another computer, I get the following error

Server Error in '/reports' Application.

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

I'm at a loss as to how to fix this. I dont really want each user to have to enter any log in information, frankly, the permissions dont even matter in this case. My main problem is with the sql connection and trying to get adequate permissions to run queries.

Any help would be apprieciated

<deny users="?" /> denyANONYMOUS user. Ifthe permissions dont even matter and you dont really want each user to have to enter any log in information, then you can remove this <deny users="?" /> in web.config <authorization> section.

|||

Xiaohong wrote:

<deny users="?" /> denyANONYMOUS user. Ifthe permissions dont even matter and you dont really want each user to have to enter any log in information, then you can remove this <deny users="?" /> in web.config <authorization> section.

This all gets back to the security problem with the sql connection. It generates error messages when it gets to the sqlCommand.Fill(dataset) part. If I dont do some kind of authentication, the sqlconnect returns an error message. I just need enough permissions to connect to the sql server

No comments:

Post a Comment