Issue Details (XML | Word | Printable)

Key: JDBC-460
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: John Kilin
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

Can't connect to the FB 3 server with AuthServer = Legacy_Auth.

Created: 25/Nov/16 10:52 AM   Updated: 18/Dec/16 03:30 PM
Component/s: JDBC driver
Affects Version/s: Jaybird 3.0.0-beta-1
Fix Version/s: Jaybird 3.0.0-beta-2, Jaybird 3.0.0


 Description  « Hide
I try to connect with Jaybird-3.0.0-beta-1-JDK_1.8 to the FB 3 server with configuration parameters:
AuthServer = Legacy_Auth
UserManager = Legacy_UserManager
and receive error:
Caused by: java.sql.SQLException: Your user name and password are not defined. Ask your database administrator to set up a Firebird login. [SQLState:28000, ISC error code:335544472]
at org.firebirdsql.gds.ng.FbExceptionBuilder$Type$1.createSQLException(FbExceptionBuilder.java:479)
at org.firebirdsql.gds.ng.FbExceptionBuilder.toFlatSQLException(FbExceptionBuilder.java:293)
at org.firebirdsql.gds.ng.wire.AbstractWireOperations.readStatusVector(AbstractWireOperations.java:132)
at org.firebirdsql.gds.ng.wire.AbstractWireOperations.processOperation(AbstractWireOperations.java:196)
at org.firebirdsql.gds.ng.wire.AbstractWireOperations.readOperationResponse(AbstractWireOperations.java:155)
at org.firebirdsql.gds.ng.wire.version13.V13WireOperations.authReceiveResponse(V13WireOperations.java:105)
at org.firebirdsql.gds.ng.wire.version10.V10Database.authReceiveResponse(V10Database.java:566)
at org.firebirdsql.gds.ng.wire.version10.V10Database.attachOrCreate(V10Database.java:110)
at org.firebirdsql.gds.ng.wire.version10.V10Database.attach(V10Database.java:80)
at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:148)
at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.java:520)
at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.java:65)
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:117)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:137)

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 25/Nov/16 10:59 AM
Which Firebird version are you using, if Firebird 3.0.0, make sure that the user **only** exists for Legacy_Auth.

John Kilin added a comment - 25/Nov/16 11:13 AM
Server Version LI-V6.3.1.32609 Firebird 3.0

OK, i check but why i have no problem when connect by fbclient or jaybird 2.2.11?

John Kilin added a comment - 25/Nov/16 11:25 AM
I try "the user **only** exists for Legacy_Auth" I still get the error.

Mark Rotteveel added a comment - 25/Nov/16 01:39 PM
I will see if I can reproduce this, because I realize that I have recently only tested it with AuthServer=Srp,Legacy_Auth, and not with only AuthServer=Legacy_Auth.

Mark Rotteveel added a comment - 25/Nov/16 04:22 PM - edited
I can reproduce it when AuthServer=Legacy_Auth, but it works OK when AuthServer=Srp,Legacy_Auth.

I'll need to investigate this further, but changing to AuthServer=Srp,Legacy_Auth (and restarting Firebird) is the workaround.

The reason it works fine with Jaybird 2.2.11 is that Jaybird 2.2.11 and earlier only supports wire protocol version 10 and the legacy legacy authentication (not a typo), while Jaybird 3 has a fundamentally rewritten implementation to support wire protocol versions 10, 11, 12, and 13. For version 13 (Firebird 3), the method of authentication has also changed significantly to support multiple authentication plugins, and it looks like Jaybird is doing something wrong there when Firebird does not have Srp in the list of supported authentication plugins.

John Kilin added a comment - 25/Nov/16 06:14 PM
I get by Wireshark the attach packets:
fbclient.dll
0000 00 00 00 13 00 00 00 00 00 00 00 06 4f 4c 41 50 ............OLAP
0010 4a 4b 00 00 00 00 00 6d 01 4a 2d 43 3a 5c 50 72 JK.....m.J-C:\Pr
0020 6f 67 72 61 6d 20 46 69 6c 65 73 20 28 78 38 36 ogram Files (x86
0030 29 5c 49 42 20 45 78 70 65 72 74 5c 69 62 65 78 )\IB Expert\ibex
0040 70 65 72 74 2e 65 78 65 50 1c 57 49 2d 56 33 2e pert.exeP.WI-V3.
0050 30 2e 31 2e 33 32 35 39 30 20 46 69 72 65 62 69 0.1.32590 Firebi
0060 72 64 20 33 2e 30 3e 00 4d 00 1c 04 4a 4f 48 4e rd 3.0>.M...JOHN
0070 3a 04 00 00 00 00 47 04 d8 13 00 00 30 07 57 49 :.....G.....0.WI
0080 4e 31 32 35 31 00 00 00 N1251...

jaybird 3.0.0
0000 00 00 00 13 00 00 00 00 00 00 00 06 4f 4c 41 50 ............OLAP
0010 4a 4b 20 20 00 00 00 81 02 4d 04 00 00 00 01 00 JK .....M......
0020 00 00 30 04 00 00 00 55 54 46 38 1c 04 00 00 00 ..0....UTF8.....
0030 4a 4f 48 4e 56 0b 00 00 00 4c 65 67 61 63 79 5f JOHNV....Legacy_
0040 41 75 74 68 55 0b 00 00 00 4c 65 67 61 63 79 5f AuthU....Legacy_
0050 41 75 74 68 54 16 00 00 00 33 34 36 46 33 35 34 AuthT....346F354
0060 34 35 30 35 38 36 34 33 34 34 44 36 32 33 32 3f 4505864344D6232?
0070 04 00 00 00 03 00 00 00 50 1c 00 00 00 4a 61 79 ........P....Jay
0080 62 69 72 64 20 33 2e 30 2e 30 2d 62 65 74 61 2d bird 3.0.0-beta-
0090 31 2d 4a 44 4b 5f 31 2e 38 00 00 00 1-JDK_1.8...

It's very different.

John Kilin added a comment - 25/Nov/16 06:49 PM
And yes with AuthServer=Srp,Legacy_Auth no errors.

Mark Rotteveel added a comment - 26/Nov/16 10:17 AM
I found the problem. When adding the authentication information to the DPB, the authentication bytes were always converted to a hexadecimal string, but this only has to happen for the SRP authentication data, and not for legacy auth. This works OK when both Srp and Legacy_Auth are enabled on the server, because then the legacy auth is done in an authentication continuation packet, and not through the DPB.

The differences you observed in the attach packets is because Jaybird will always use DPB version 2 with wire protocol 13, but fbclient will initially start with DPB version 1, and only upgrade to DPB version 2 if it is really necessary, and the order of DPB items and actual DPB items in the packet differ.

I will probably release a beta-2 later this (or next) week. Let me know if you want a snapshot for testing.

John Kilin added a comment - 26/Nov/16 11:35 AM
Thanks! I'll wait for the beta-2.