0
votes

I have Oracle XE 11g running on Windows 7 host I am able to connect to Oracle using OS Authentication in SQLPlus I am able to connect to Oracle in Delphi using TSQLConnection with username and password

When I blank the username and password in SQLConnection.Params and set OSAuthentication and/or OS Authentication (all combinations) params to True and attempt to set Connected to True I get:

ORA-01017: invalid username/password; Logon denied;

Has anyone connected to Oracle using OS Authentication using Delphi and dbExpress?

1
TSQLConnection uses the user associated with the calling thread unless told otherwise. So try using Win32 impersonation when connecting with a blank username/password. - Remy Lebeau
I'm not familiar with Win32 impersonation. Wouldn't the user associated with the calling thread be %userdomain%\%username% ? When I do a Windows API call to get those values they are what my Oracle server would expect for OS Authentication. - kahlersd
Impersonation is done using ImpersonateLoggedOnUser() or related function. The user associated with the thread is the user who started the app's process by default, unless the thread impersonates another user programmably. - Remy Lebeau

1 Answers

0
votes

When connecting to Oracle XE 11g running on my Windows 7 host through sqlplus running on the same host the Oracle account expected is "OPS$%userdomain%\%username%". When connecting remotely through a Linux VM only "OPS$%username%" is expected. When running Delphi on the same Windows 7 host the TSqlConnection seems to be acting like a remote connection, so I was able to use OS Authentication when logged in to Windows as %username% using the Oracle "OPS$%username% user. Hope that makes sense.