Click to See Complete Forum and Search --> : Trusted Connection - SQL Server
odamsr
12-14-2005, 09:44 AM
Is it possible in .Net to log into sql server using the windows login instead of using the rights of ASPNet account? In VB I usually set it to trusted connection and it automatically uses the user's account.
Thanks
Shannon
Cipher
12-14-2005, 10:25 AM
try this in your connection
ConnectString = "initial Catalog=DataBase; Integrated Secutiry=SSPI"
odamsr
12-14-2005, 11:37 AM
That is what I have now but the ASPNet account is used and not the user's windows account. At the moment the aspnet account must have access to all of the databases and I am trying to use the user's account.
Thanks
Shannon
sirpelidor
12-14-2005, 01:40 PM
not sure if this can help, but you may wanna give a try:
1) backup your current setting
2) add Impersonation to your web.config
i.e:
<configuration>
<system.web>
<!-- other settings omitted. -->
<identity impersonate="true" userName="(sql login name goes here)" password=" (sql pw goes here) >
</system.web>
</configuration>
noticed password for impersonated account cannot be encrypted in web.config, so there's a security risk (at the same time, IIS won't allow u can't access web.config through a browser)
give a shot and see how it goes :)