cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jeanmarc78
Level 5

windows auth and web.config - basic msi

Hi,

I know how to configure my web.config file with the manual server connection dialog (when the sql connection is asked) but I don't know how to configure my web.config when the customer choose the windows Authentification? it seems that it's not the same property to get the user and the pwd...
furthermore, does some know if it's possible to create a SQL instance instead of browsing it ?

Thanks
Labels (1)
0 Kudos
(5) Replies
cbragg
Level 7

When you set windows authentication it doesn't have a username and password property because it uses the credentials of the user running the application. Now with web applications this means something completely different. What it means by default is the service account running IIS which is usually the system account. But wait... it's not a good idea to go changing that account to something else just to suit your web application or go off permissioning the system account to the database etc. The best way to do this is to create a new application pool in IIS and assign your website to that application pool. In the properties of the application pool are identity details. If you set your account in there then you should be good to go. You can set all of this up using Installshield built-in functionality and the username and passwords can be set up to use properties from your install dialogs

😄
0 Kudos
jeanmarc78
Level 5

I tried that but it's not what I want.
here is the web.config line i want to configure:
" connectionString="Data Source='%SERVER%';Initial Catalog=cml3;User Id=%UID%;Password=%PWD%; "

%SERVER% : it's the path for the database file, for that it's ok
%UID and %PWD% refer to the database users and for now I can configure it only when the customer chose sql authentification in the SQL login dialog (using text replacement). So, when the user chose windows auth, the properties i use don't work (IS_SQLSERVER_USERNAME and IS_SQLSERVER_PASSWORD) cause they are not the same (naturally...).
it seems that it use %USERNAME% windows environment property but i'm not sure, and I don't know for the password yet (maybe %PASSWORD% ?).
Even if it is correct, how can i do to select the good property according to the customer's choice? (windows auth or sql auth)

Now my boss wants another option: creating a new server inscription with specific users (like one admin and 2 users). He thinks that will help cause we would know how to configure our web.config ( with for example the "admin" profile )

Thanks again
0 Kudos
Lurean
Level 8

when using windows integrated security the connection string looks a little different.

normally you would use something like this

"Data Source=Your_Server_Name;Initial Catalog= Your_Database_Name;UserId=Your_Username;Password=Your_Password;"


in windows integrated security it would look like this.

"Data Source=Your_Server_Name;Initial Catalog=Your_Database_Name;Integrated Security=SSPI;"


there may be other configuration that needs to occur that I am not aware of as we don't use the integrated security.
0 Kudos
cbragg
Level 7

As stated before when using integrated security it uses the service account to attach to the database. You CANNOT specify a username and password. So the ONLY way to use integrated security is to change the IIS service account and continue to use the default application pool or to create your own application pool and use the credentials in the identity rather than specifying them in a connection string. User Id and password properties can only be used with SQL authentication connection strings. Secondly, if you could specify windows credentials this would mean you will have an open text username and password in an unencrypted file. If you are worried about wanting to use credentials provided by the user in your GUI, then it's worth noting that you can provide your application pool credentials using installer properties (please note this is easier to edit in the table directly because the GUI will show asterisks for the password when you enter your property)
0 Kudos
jeanmarc78
Level 5

Thanks all of you, it's ok now. 😉
0 Kudos