Re: sspi connection throws NoSuchMethodError: com.such.jna.platform.win32.Sspi$SecBufferDesc with Waffle 2.3.0

Поиск
Список
Период
Сортировка
От Jorge Solórzano
Тема Re: sspi connection throws NoSuchMethodError: com.such.jna.platform.win32.Sspi$SecBufferDesc with Waffle 2.3.0
Дата
Msg-id CA+cVU8OuqY8zgCVeyBpS1Au2pbG=pWKiffwi38YoBT_LBWw1TA@mail.gmail.com
обсуждение исходный текст
Ответ на sspi connection throws NoSuchMethodError: com.such.jna.platform.win32.Sspi$SecBufferDesc with Waffle 2.3.0  ("LE MENTEC, SANDRINE" <sandrine.le-mentec@capgemini.com>)
Ответы RE: sspi connection throws NoSuchMethodError: com.such.jna.platform.win32.Sspi$SecBufferDesc with Waffle 2.3.0
Список pgsql-jdbc
Hi Sandrine,

The version of waffle that should work with pgjdbc is 1.9.1:

Regards,

On Fri, Apr 16, 2021 at 12:05 PM LE MENTEC, SANDRINE <sandrine.le-mentec@capgemini.com> wrote:

Dear community,

 

I am currently trying to set up a project with sspi authentication on a windows server. I use the jdbc postgresql-42.2.18.jar with a postgres 12.5.

I have downloaded the waffles libraries as recommanded here : https://jdbc.postgresql.org/documentation/94/connect.html and added them to the classpath project.

 

I have tried this part of code in a Test :

 

String url = ʺjdbc:postgresql://<serveradress>:<portnumber>/<databasename>?gsslib=sspiʺ;

Connection conn = DriverManager.getConnection(url);

 

The code throws the following exception :

NoSuchMethodError: com.such.jna.platform.win32.Sspi$SecBufferDesc at org.postgresql.sspi.SSPIClient.continueSSPI(SSPIClient.java :204).

 

When I looked the pgjdbc github of the SSPIClient class (https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/sspi/SSPIClient.java), I have noticed that the following constructor is used : SecBufferDesc(Sspi.SECBUFFER_TOKEN, receivedToken).

 

The SecBufferDesc class comes from the jna.platform librairy 5.0.0 (com.sun.jna.platform.win32.Sspi.SecBufferDesc) provided by the waffle librairies 2.3.0.

 

Looking at the SecBufferDesc class inside the jna.platform 5.0.0, there is only one constructor (SecBufferDesc()). There is no constructor SecBufferDesc(int type, int tokenSize)anymore.

 

Doing a little research, the problem seems to be known by the waffle community (https://github.com/Waffle/waffle/issues/838).

 

It seems that it is not possible to use the last Waffle version (2.3.0) to do sspi authentication with the pgjdbc because of that.

 

Do you know witch version of the Waffle libraries I should use to enable SSPI authentication with the pgjdbc ? Do you think I should report this issue as a bug on the pgjdbc github ?

 

Thanks for your help,

Regards,

____________________________________________________________________

Sandrine Le Mentec

Software Engineer | CSD

 

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "LE MENTEC, SANDRINE"
Дата:
Сообщение: sspi connection throws NoSuchMethodError: com.such.jna.platform.win32.Sspi$SecBufferDesc with Waffle 2.3.0
Следующее
От: "LE MENTEC, SANDRINE"
Дата:
Сообщение: RE: sspi connection throws NoSuchMethodError: com.such.jna.platform.win32.Sspi$SecBufferDesc with Waffle 2.3.0