Mike,
The most common approach to this common problem is to specify SQL
credentials in the connection string. The downside here is that you need to
protect the connection string at storage, which is a challenge, but unless
you have certain specific conditions, you do not have many alternatives. If
you want to propagate user's credentials to SQL server, you have to enable
delegation at the AD domain level, which is not a good idea from security
perspective. And what is worse, your app will not be able to use connection
pooling, so the scalability goes down he drain. If you want to connect to
SQL Server using credentials of the IIS worker process, you either need to
run the IIS process as a domain user or set them identically on both the SQL
serve and Web server using a local account (with the same password). I don't
think that either of these options is good, because if you do this (for one,
any application running under your Web site will be able to connect to SQL
server with privileged rights). The bottom line here is that you will
introduce more problems than you solve. Just go with the SQL credentials in
the connection string. From my experience, this is what most enterprise apps
do.
Alek
> Hi,
>
[quoted text clipped - 23 lines]
>
> <M>ike
<M>ike - 22 Jun 2004 10:42 GMT
Thanks AleK,
That certainly sounds good and reinforces what I was thinking. I think I
will try to save the credentials in the Web.config file as AppSetting keys
so they are not saved in each page and should be more secure.
Cheers,
<M>ike
> Mike,
>
[quoted text clipped - 47 lines]
> >
> > <M>ike
Alek Davis - 22 Jun 2004 16:57 GMT
Just make sure that the credentials are encrypted.
Alek
> Thanks AleK,
>
[quoted text clipped - 70 lines]
> > >
> > > <M>ike
<M>ike - 23 Jun 2004 11:50 GMT
Any top tips on how to encrypt these credentials. I guess the details are
decrypted by a function in a class within the project every time they are
needed?
<M>ike
> Just make sure that the credentials are encrypted.
>
[quoted text clipped - 83 lines]
> > > >
> > > > <M>ike
Maras - 23 Jun 2004 15:55 GMT
> Any top tips on how to encrypt these credentials. I guess the details are
> decrypted by a function in a class within the project every time they are
> needed?
Read about aspnet_setreg tool.

Signature
Best regards
Maras
Alek Davis - 23 Jun 2004 17:02 GMT
This is a tough problem to solve and depending on your environment some
approaches may be worse than others. Check the "Protect It: Safeguard
Database Connection Strings and Other Sensitive Settings in Your Code"
article at http://msdn.microsoft.com/msdnmag/issues/03/11/ProtectYourData/,
it addresses this topic.
Alek
> Any top tips on how to encrypt these credentials. I guess the details are
> decrypted by a function in a class within the project every time they are
[quoted text clipped - 101 lines]
> > > > >
> > > > > <M>ike
<M>ike - 22 Jun 2004 10:53 GMT
Top Tip:
I've also noticed that if you're using passed credentials to connect to the
SQL box it helps if the server is set to accept both SQL Server and Windows
authentication, otherwise you kep getting (and getting and getting) the good
old 'Not a Trusted Connection' error message.
<M>ike