Does Firebird ADO.NET 4.10.0.0 Data provider work with Firebird 3.0?
Asked Answered
B

1

3

I'm currently trying to get my ASP.net 4.5 project connecting to the recently release Firebird 3.0.

I'm using Visual Studio 2015 Community edition, Firebird 3 (64 bit), and used NuGet to get the ADO.NET 4.10.0.0.

However, when I try to connect, I get an exception withe the following message:

this.connect.ServerVersion threw an exception of type 'System.InvalidOperationException'

Some other messages that I get:

Message: "The connection is closed"
Source: FirebirdSQL.Data.Fierbird.Client
StackTrace:
at FirebirdSql.Data.FirebirdClient.FbConnection.get_ServerVersion() in C:\Users\Jiri\Documents\devel\NETProvider\working\NETProvider\src\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbConnection.cs:line 217

IBExpert connects without any problems.

This environment previously worked with Firebird 2.5 and an older ADO.Net

Best guess right now is that it's not supported but my research online was inconclusive (from what I could find, there were indications that it was tested with Firebird 3 RC1)

If anyone can point me in the right direction to get this going, it would be awesome.

Thanks in advance!

Bioluminescence answered 20/4, 2016 at 19:4 Comment(3)
Did you configure Firebird 3 for legacy authentication, and did you create a legacy account, or did you just install and go?Uretic
there will be a beta next week: mail-archive.com/[email protected]/…Bevis
Are there any updates on the beta provider?Chiton
U
8

I am answering this on the assumption that you installed Firebird 3 and did not modify any of its configuration. By default the installation of Firebird 3 will have some strict security settings:

  • It will only support the new SRP authentication model
  • It will require wire protocol encryption

This means that drivers (like Firebird .NET provider 4.10) that do not yet support the SRP authentication model and wire protocol encryption will not be able to connect out of the box.

To be able to connect you will need to do the following

  1. Enable the legacy authentication model
  2. Downgrade the wire protocol encryption setting from required to enabled
  3. Create a user in the legacy authentication model

These steps all require edits to firebird.conf. If you installed Firebird into Program Files, you need to make sure your editor is running as administrator to be able to save the changes.

Enable legacy authentication

To enable legacy authentication, you need to edit or add the following line to firebird.conf: (note that lines prefixed with # are comments!)

AuthServer = Srp, Legacy_Auth

Downgrade wire protocol encryption

To downgrade the wire protocol encryption setting, you need to edit or add the following line to firebird.conf:

WireCrypt = Enabled

Create a legacy authentication user

To be able to create a user in the legacy authentication model, you need to enable the legacy usermanager plugin by editing or adding the following line to firebird.conf:

UserManager = Srp, Legacy_UserManager

After above changes, restart Firebird, connect to (any) Firebird 3 database with your favorite database management tool using SYSDBA or another admin account and create a user using the Legacy_UserManager with CREATE USER (replace username and password legacy with suitable values):

CREATE USER legacy PASSWORD 'legacy' USING PLUGIN Legacy_UserManager

Make sure to commit, otherwise the user is not really created.

Now you should be able to connect from C# using the user you just created.

This is also documented in the Firebird 3 Release Notes, Chapter 12 Compatibility Issues, Legacy Authentication.

Using gsec or the services functionality to create users is deprecated. If you still want to use either of these to create users in the legacy authentication model, you need to edit firebird.conf and put Legacy_UserManager first in the list.

Support in Firebird .NET provider version 5.0.0.0 and higher

Note that Firebird .NET provider version 5.0.0.0 added support for SRP (without wire protocol encryption). So from Firebird .NET provider version 5 you can use the new authentication model. Just make sure that you downgrade the wire protocol encryption (setting WireCrypt) from Required (default) to Enabled as described above.

Uretic answered 23/4, 2016 at 7:24 Comment(3)
Thank you Mark. After trying your steps, I still had issues but basically ran the installer again with default settings but with legacy authentication enabled. I reviewed the changes in Firebird.conf that you indicated and although they are slightly different, the key points were all there. I did run into some odd behaviour (which could be from IBExpert or the fact that I'm trying this at 1:30AM and making mistakes) but I'll do my testing later and post a separate question if I have one. Thank you very much for the walk-through!Bioluminescence
@Bioluminescence I tested it with a fresh install of Firebird 3, so I would expect my steps to work. If you have created a user that exists both for Srp and Legacy_Auth, you might run into this problem: #36814202Uretic
Thanks Mark, the problem you linked to is exactly what I noticed. But your description there explains why I saw two SYSDBA accounts. Thanks for explaining this!Bioluminescence

© 2022 - 2024 — McMap. All rights reserved.