Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to log users in to sqlserver through asp.net

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
US
I have an IIS6 server and a sqlserver 2008 server on a 2008r2 domain. Each server is a dedicated machine. One IIS machine and one sqlserver machine. I want to create an asp.net application running on the IIS server that users who are logged on to the domain can use to access the sqlserver db. I dont want to create a bunch of new users in asp.net or anything like that, I want to use windows security. I've done some searches about security but havn't found anything simple enough that I can figure it out. Can anybody give me the right buzzwords to point me to how to set up security to do this?

thanks

 
Code:
<system.web>
  <authentication mode="Windows"/>
  <identity impersonate="true" />
</system.web>
<connectionStrings>
   <add name="value" connectionString="..." providerName="type of connection" />
</connectionStrings>
you can use either a trusted connection which will use the windows identity to connect to the sql server or you can provide a sql server user/password.

your system will take advantage of connection pooling if you setup a common sql username/password rather than using the clients windows identity. In this setup your application will see the clients windows identity, but connect to the database using the provided sql username.

the connection provider name isn't required if you directly instantiate your connection objects. [tt]new SqlConnection(...)[/tt]. If you take advantage of an ORM framework, or use the db provider factory the provider is required. this is how the system determines what type of connection to use.


Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top