Skip to content

Password using specific chars #1217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ArturGomesSoft opened this issue Apr 2, 2025 · 5 comments
Open

Password using specific chars #1217

ArturGomesSoft opened this issue Apr 2, 2025 · 5 comments

Comments

@ArturGomesSoft
Copy link

ArturGomesSoft commented Apr 2, 2025

Hi.
Have a problem connection to a database using a password that has special Norwegian chars on it (æøå).
Although I'm able to login using, for instance, DBeaver, I'm not able to connect using this user. Definitely is a charset problem, since if I change the password to something "normal", the thing works correctly.
I tried to make some encoding work on the string, with nor success.
Any thoughts?

PS:
This is how I'm creating the connection string. I tried as well as creating it manually, with the same results.

FbConnectionStringBuilder cs = new FbConnectionStringBuilder();
if (this.ServerName == string.Empty)
{
this.ServerName = "LOCALHOST";
}
cs.Database = this.DatabaseFile;
cs.DataSource = this.ServerName;
cs.Port = this.PortNumber;
cs.UserID = this.UserName;
cs.Password = pass;
cs.Charset = "ISO8859_1";
cs.Role = "HKADMINISTRATOR";
cs.Add("Authentication", "Legacy_Auth");
cs.Add("ExtendedMetadata", false);

@mrotteveel
Copy link
Member

Which Firebird version are you using? Also, I'm not clear about the situation of DBeaver. Are you able to login in DBeaver with the user and password, or not? Also, the code you show is C# code, not Java code, so is your problem with Java or with C#?

@ArturGomesSoft
Copy link
Author

Sorry the misunderstanding.
The problem is in c#, using FirebirdSql.Data.FirebirdClient version 10.3.2
I'm able to login using DBeaver, and from a Delphi made software. Debugged Delphi code and no special remarks on password. Just used as plain text.
The database is Firebird 2.5.9. Can't upgrade, since this is to extract some reports from legacy software.

@mrotteveel
Copy link
Member

I'm transferring your question to https://github.com/FirebirdSQL/NETProvider, as that is where it belongs.

The problem has likely to do with which character set is used to encode the password into the database parameter buffer. I guess UTF-8 is used, and that will not work for the legacy authentication used in Firebird 2.5 and older (and the Legacy_Auth plugin of Firebird 3.0 and higher).

Funnily enough, this did make me uncover an authentication error against Firebird 3.0 and higher with Legacy_Auth in Jaybird.

@mrotteveel mrotteveel transferred this issue from FirebirdSQL/jaybird Apr 2, 2025
@ArturGomesSoft
Copy link
Author

That's fantastic that made you improve your work.
Sorry for not putting this in the correct place.
I'll be following the thing there.
Thanks again.

@ArturGomesSoft
Copy link
Author

Hi. Any comments on this? Progress?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants