| From: | Jorge Solórzano <jorsol(at)gmail(dot)com> |
|---|---|
| To: | "LE MENTEC, SANDRINE" <sandrine(dot)le-mentec(at)capgemini(dot)com> |
| Cc: | "pgsql-jdbc(at)lists(dot)postgresql(dot)org" <pgsql-jdbc(at)lists(dot)postgresql(dot)org>, "KOUMIRA, Adnane" <adnane(dot)koumira(at)capgemini(dot)com> |
| Subject: | Re: sspi connection throws NoSuchMethodError: com.such.jna.platform.win32.Sspi$SecBufferDesc with Waffle 2.3.0 |
| Date: | 2021-04-16 11:06:58 |
| Message-ID: | CA+cVU8OuqY8zgCVeyBpS1Au2pbG=pWKiffwi38YoBT_LBWw1TA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-jdbc |
Hi Sandrine,
The version of waffle that should work with pgjdbc is 1.9.1:
https://github.com/pgjdbc/pgjdbc/blob/f3301c140d8321ce29cf63b418e44623f84e0ba0/gradle.properties#L61
Regards,
On Fri, Apr 16, 2021 at 12:05 PM LE MENTEC, SANDRINE <
sandrine(dot)le-mentec(at)capgemini(dot)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*
> <https://java-native-access.github.io/jna/4.2.1/com/sun/jna/platform/win32/Sspi.SecBufferDesc.html#SecBufferDesc-->
> *()*). There is no constructor *SecBufferDesc*
> <https://java-native-access.github.io/jna/4.2.1/com/sun/jna/platform/win32/Sspi.SecBufferDesc.html#SecBufferDesc-int-int->*(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.
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | LE MENTEC, SANDRINE | 2021-04-16 12:01:28 | RE: sspi connection throws NoSuchMethodError: com.such.jna.platform.win32.Sspi$SecBufferDesc with Waffle 2.3.0 |
| Previous Message | LE MENTEC, SANDRINE | 2021-04-16 09:09:39 | sspi connection throws NoSuchMethodError: com.such.jna.platform.win32.Sspi$SecBufferDesc with Waffle 2.3.0 |