[FAQ]Windows Security: using integrated security in connection string.

APGvNext Sam
vNext Dev
  • Total Posts : 13221
  • Joined: 2001/05/23 00:00:00
  • Status: offline
2003/02/19 18:45:03 (permalink) Setup

Windows Security: using integrated security in connection string.

If you need to use Trusted Connection to connect to your SQL server, please follow the instruction below carefully (the following technique applies only to those who run both SQL and Web servers on the same machine):

Open ~/config/sqlconnections.config

  • for version 3, open web.config
Then, make sure you enter the following into the "ForumSoftwareConnection" connection string:
Integrated Security=SSPI; initial catalog=dbName; Data source=dbServer; persist security info=False; Trusted_Connection=Yes

Open web.config

Add the following in between <system.web></system.web> to force ASP.NET to run under the IUSR account:
<authentication mode = "windows" />
<identity impersonate="true" />

Finally, using SQL Management Studio, add your IUSR account to the "Users" section.

Don't forget to set the correct permission for the IUSR account to access the database - you can simply add the IUSR account into the "db_owner" standard role if you want to use all features of the software.
You can tighten the security by giving the IUSR account db_datareader + db_datawrite (BOTH, not either or). Note that with this lesser security privilege you won't be able to upgrade your db to a newer version, but you can use it for regular forum operations just fine.

It is much more complicated to use Trusted Connection (Windows Authentication) than to use the plain SQL Authentication.
Instead, you can encrypt SQL connection string to protect your SQL user account password.

post edited by Samuel - 2013/02/26 16:23:29

1 Reply Related Threads

    New Member
    • Total Posts : 1
    • Joined: 2015/05/10 22:11:40
    • Status: offline
    Re: Windows Security: using integrated security in connection string. 2015/05/10 22:14:03 (permalink)
    More about...
    Jump to:
    © 2019 APG vNext Commercial Version 5.5