Cannot connect with TMSConnection in a service applciation with Win auth
Posted: Thu  04 May 2017 08:46
				
				I am not able to connect with TMSConnection  when autentication is auWIndows and I am in a service application.
There seems an issue with service applciation only, because with standalne exe all is fine. In fact i found this problem when working on an intraweb (VCL for the web) project comparing the standalone exe and the service version of it.
Anyway i am able to reproduce it also on a sample project, i am going to send the sample project plus a video that descibes it by email at [email protected] now.
When the problem occurs in the service there is an exception and the exception messages says that
DBConn : TMSConnection;
///
DbConn.Username := 'MYDOMAIN\USER';
DbConn.Password := 'password';
DbConn.Server := 'SERVER';
DbConn.Database := 'master';
DbConn.Authentication := auWindows;
dbConn.LoginPrompt := false;
DbConn.Connect;
On Connect the exception message says that the user that cannot authenticate is not DOMAIN\USER, but MYDOMAIN\MYCOMPUTERNAME$.
There is one important info you could ask me: why are you passing the password? Because I want to connect with Windows authentication using any user, not necessarly my one. (I want to log in to intraweb application by passing any domain user + password). I am not 100% sure the technique i use is fine, anyway since it works on win32exe and not on service i see there is a problem.
Since this is a very significant problem for me please reply me soon. I suspect this is a SDAC bug, but i cannot be sure.
I am using SDAC 8.01 on Delphi 10 on Windows 7.
			There seems an issue with service applciation only, because with standalne exe all is fine. In fact i found this problem when working on an intraweb (VCL for the web) project comparing the standalone exe and the service version of it.
Anyway i am able to reproduce it also on a sample project, i am going to send the sample project plus a video that descibes it by email at [email protected] now.
When the problem occurs in the service there is an exception and the exception messages says that
DBConn : TMSConnection;
///
DbConn.Username := 'MYDOMAIN\USER';
DbConn.Password := 'password';
DbConn.Server := 'SERVER';
DbConn.Database := 'master';
DbConn.Authentication := auWindows;
dbConn.LoginPrompt := false;
DbConn.Connect;
On Connect the exception message says that the user that cannot authenticate is not DOMAIN\USER, but MYDOMAIN\MYCOMPUTERNAME$.
There is one important info you could ask me: why are you passing the password? Because I want to connect with Windows authentication using any user, not necessarly my one. (I want to log in to intraweb application by passing any domain user + password). I am not 100% sure the technique i use is fine, anyway since it works on win32exe and not on service i see there is a problem.
Since this is a very significant problem for me please reply me soon. I suspect this is a SDAC bug, but i cannot be sure.
I am using SDAC 8.01 on Delphi 10 on Windows 7.