簡體   English   中英

Firebird 2.5中的Windows身份驗證

[英]Windows Authentication in Firebird 2.5

我可以使用Windows用戶而不是使用SYSDBA和MASTERKEY憑據登錄firebird數據庫嗎? 如果是,請告訴我連接firebird數據庫的方法。

我正在使用Delphi XE3和Firebird 2.5。 我需要在更新“受信任”的配置文件后,通過登錄用戶驗證用戶,而不是默認的“native”,如下所示: https//firebirdsql.org/file/documentation/release_notes/html/en/2_5/rnfb25- fbconf-authent.html

這是我的代碼:

SQLConnection1.LoginPrompt := False;
//SQLConnection1.Params.add('user_name='); 
//SQLConnection1.Params.add('password='); 
SQLConnection1.Params.add('os authentication=True') ; 
SQLConnection1.Connected:= True

它仍然要求提供證書。

(V.2.1)從Firebird 2.1開始,可以應用Windows“可信用戶”安全性來驗證Windows主機上的Firebird用戶。 可信用戶的安全上下文將傳遞給Firebird服務器,如果成功,則用於確定Firebird安全用戶名。

在幾乎所有情況下,只需從DPB / SPB中省略用戶和密碼參數,就會自動導致應用Windows受信任用戶身份驗證。 有關例外情況,請參閱下面的“環境”部分

來自官方文件

另外,看看這個問題 - https://dba.stackexchange.com/questions/154735/how-to-enable-windows-authentication-in-firebird-2-5

如果未設置TSQLConnection對象的User_Name參數(User_Name= ) ,則使用Windows身份驗證連接模式。

還要在firebird.conf文件中設置Authentication = mixed或trusted, 並重新啟動FirebirdServer服務

如果未在代碼中設置user_name和'password'參數(在代碼中已注釋),請在設計時添加它們。 僅添加User_Name足夠了。

如果你想使用:

SQLConnection1.Params.add('user_name='); // this is enough
SQLConnection1.Params.add('password='); 

在設計時從SQLConnection.Params中刪除user_namepassword參數。

注意: 不要使用:

SQLConnection1.Params.Values['User_Name'] := '';

這只是從列表中刪除參數。

更新

在此輸入圖像描述

這適合我。 正如您在firebird.conf中看到的那樣,Autentication僅受信任。 SQLConnection參數:用戶名和密碼為空。 並且SQLConnection已連接。

嘗試重復這張照片。

A'm使用Delphi 2010。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM