FirebirdSql.EntityFrameworkCore.Firebird (9.1.0): trusted connection / Windows authentication possible?

44 views
Skip to first unread message

Robert Meyer

unread,
Nov 25, 2022, 10:52:38 AM11/25/22
to firebird-net-provider
Hello,

I am using FirebirdSql.EntityFramworkCore.Firebird (9.1.0) in a .NET 6 console application for data ex- and import between 2 applications and I would like to know if it is possible there to also use a trusted connection/Windows authentication?

I tried to remove "user=..." and "password=..." from the ConnectionString via optionsBuilder.UseFirebird but that did not work also I didn't find any other parameters in  FbDbContextOptionsBuilder myself for "activating" a trusted connection.

The server / firebird database is accepting trusted connections / Windows authentication which I also checked with IBExpert on my client.

Is a trusted connection perhaps not supported via EFCore 6 at the moment or does anyone know how to implement that with EFCore?

Thank you very much and kind regards,
Robert.

Jiří Činčura

unread,
Nov 25, 2022, 11:18:57 AM11/25/22
to 'Mr. John' via firebird-net-provider
Hi,

trusted connection/SSPI is property of ADO.NET provider and it is not related to EF Core provider (unless there's some bug of course). Can you validate that the username and password is really not set? Because that's the only condition that's checked (https://github.com/cincuranet/FirebirdSql.Data.FirebirdClient/blob/master/src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbConnectionInternal.cs#L250) (and test https://github.com/cincuranet/FirebirdSql.Data.FirebirdClient/blob/master/src/FirebirdSql.Data.FirebirdClient.Tests/FbConnectionTests.cs#L349-L350).

--
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/

Robert Meyer

unread,
Nov 25, 2022, 1:16:32 PM11/25/22
to firebird-net-provider
Hi Jiří,

thank you very much for your quick response!

It works now and I am already embarrassed because the trusted connection also worked before but I didn't realize it.
Now that I know that trusted connection should work I did a deeper inspection (which I also should do before) and found the real cause of the access error message.
The first thing I did with the database from the console application was executing a stored procedure and I did not know that if you are using a stored procedure with other users than sysdba you have to grant execution rights additionally for these users.
So the problem for my access error message was that my personal windows user didn't has rights to execute this stored procedure.

Thank you for your great work and have a nice weekend!

Kind regards,
Robert.
Reply all
Reply to author
Forward
0 new messages