Windows Authentication in Firebird 2.5
Can I log into firebird database using Windows user instead of using SYSDBA and MASTERKEY credentials? If yes, please let me know how to connect to Firebird database.
I am using Delphi XE3 and Firebird 2.5. I need to authenticate the user by logging in after updating the config file for "trusted" instead of the default "native" as stated here: https://firebirdsql.org/file/documentation/release_notes/html/en/2_5/rnfb25-fbconf- authent.html
This is my code:
SQLConnection1.LoginPrompt := False;
//SQLConnection1.Params.add('user_name=');
//SQLConnection1.Params.add('password=');
SQLConnection1.Params.add('os authentication=True') ;
SQLConnection1.Connected:= True
It still asks for credentials.
source to share
(V.2.1). Starting with Firebird 2.1, Windows "trusted user" security can be used to authenticate Firebird users to a Windows host. The security context of the trusted user is passed to the Firebird server and, if it succeeds, it is used to determine the Firebird security username.
Simply deleting user options and password from DPB / SPB will automatically trigger Windows Trusted User Authentication in almost all cases. See the Environment section below for an Exception
Also, take a look at this question - https://dba.stackexchange.com/questions/154735/how-to-enable-windows-authentication-in-firebird-2-5
source to share
If the User_Name
object parameter is TSQLConnection
not set (User_Name= )
, the Windows Authentication connection mode is used.
Also set Authentication = mixed
or trust the file firebird.conf
, and restart the FirebirdServer
If you did not specify parameters User_Name
and 'password' in the code (commented out in the code), add them at design time. That's enough to add only User_Name
.
If you want to use:
SQLConnection1.Params.add('user_name='); // this is enough
SQLConnection1.Params.add('password=');
remove the parameters User_Name
and password
from the SQLConnection.Params at design time.
Note: Do not use:
SQLConnection1.Params.Values['User_Name'] := '';
This just removes the parameter from the list.
Update
This works for me. As you can see, in firebird.conf, Autentication is only trusted. SQLConnection parameters: username and password are blank. And the SQLConnection is connected.
Try to repeat this picture.
A'm using Delphi 2010.
source to share