Version 1 - Reviewed: November 12, 2018
The objective of the article is to guide an IT administrator through the processing of setting up TariffShark CPUC Application Server (ASP.NET) to use Windows authentication when connecting to the TariffShark CPUC Database (Microsoft SQL Server).
When you use Windows authentication to connect to SQL Server, you use your application's process identity or thread identity (if your application is using impersonation) to connect. You should use Windows authentication to connect to SQL Server when possible for the following reasons:
<configuration> <appSettings> <add key="Main.ConnectionString" value="data source=$SERVER$;initial catalog=$DATABASE$;Integrated Security=SSPI;"/> </appSettings> </configuration>
You need to create a SQL Server login for your application's service account, and grant DBO permissions to access the TariffShark CPUC database.
USE [master] GO CREATE LOGIN [DOMAIN\userName] FROM WINDOWS WITH DEFAULT_DATABASE=[TariffShark_CPUC_DB] GO USE [TariffShark_CPUC_DB] GO CREATE USER [DOMAIN\userName] FOR LOGIN [DOMAIN\userName] GO USE [TariffShark_CPUC_DB] GO EXEC sp_addrolemember N'db_owner', N'DOMAIN\userName' GO
aspnet_regiis.exe -ga domainNameOrMachineName\userName
On Windows, running the Aspnet_regiis.exe -ga command adds the account to the IIS_WPG group. Membership in the IIS_WPG group grants the account the Log on as a batch job permission and ensures that the necessary file system and IIS metabase permissions are granted. If for some reason this is not done, please add the account to the IIS_WPG group.