Skip to content
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

Unable to perform SSPI authentication in DBeaver #17268

Closed
srnsomu opened this issue Aug 4, 2022 · 7 comments
Closed

Unable to perform SSPI authentication in DBeaver #17268

srnsomu opened this issue Aug 4, 2022 · 7 comments

Comments

@srnsomu
Copy link

srnsomu commented Aug 4, 2022

Description

I am using version 22.1.2 and SSPI support via waffle-jna was added in 22.0.5 according to release notes. However, when I try to perform SSPi authentication for a user, it fails with the error com.sun.jna.LastErrorException.

I am able to perform SSPi authentication for the same user using pgAdmin. It however fails with DBeaver.
I have added the waffle-jna artifact in Libraries and downloaded the driver

com.github.waffle
waffle-jna
3.2.0

After adding the artifact, I enter the username (with SSPI authentication added) in the Authentication section and I leave the password section empty. Upon clicking Test Connection, I get the error com.sun.jna.LastErrorException

Steps to reproduce

DBeaver -> Edit Driver Settings -> Libraries -> Add Artifact -> Add waffle-jna artifact with
Artifact Id: waffle-jna
group id: com.github.waffle
Version: 3.2.0
Fallback Version: RELEASE

Check Ignore transient dependencies.
Click Okay and Test Connection. An error box appears saying Connection Error

Workspace Log:
eclipse.buildId=unknown
java.version=11.0.12
java.vendor=Eclipse Foundation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en
Command-line arguments: -os win32 -ws win32 -arch x86_64

org.jkiss.dbeaver.model
Error
Thu Aug 04 11:35:37 EDT 2022
com.sun.jna.LastErrorException

java.lang.ClassNotFoundException: com.sun.jna.LastErrorException
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at org.postgresql.core.v3.ConnectionFactoryImpl.createSSPI(ConnectionFactoryImpl.java:82)
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:712)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:161)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
at org.postgresql.jdbc.PgConnection.(PgConnection.java:223)
at org.postgresql.Driver.makeConnection(Driver.java:465)
at org.postgresql.Driver.access$100(Driver.java:62)
at org.postgresql.Driver$ConnectThread.run(Driver.java:375)
at java.base/java.lang.Thread.run(Unknown Source)

PostgreSQL log:
2022-08-04 10:46:40.531 EDT [11076] FATAL: SSPI authentication failed for user "310151160@code1"
2022-08-04 10:46:40.531 EDT [11076] DETAIL: Connection matched pg_hba.conf line 83: "host all "310151160@code1" 127.0.0.1/32 sspi"

DBeaver Version

22.1.2

Operating System

Windows 10 Enterprise

@uslss
Copy link
Member

uslss commented Aug 10, 2022

thanks for the report.
seems SSPI is working with waffle-jna 1.9.1 only.
Could you try to reset driver settings to default and check if it helps?
image

@E1izabeth
Copy link
Member

connected to #1974

@srnsomu
Copy link
Author

srnsomu commented Aug 11, 2022

Hi @uslss I did try the recommendation to use waffle version 1.9.1, but it did not help. After I change to defaults, it beings up a UI to download the drivers. When I click OK on the UI, it goes into an error. I've created a screenshot recording of the same. Also, what is the password box set to when performing SSPI. I've currently set it as empty.

DBeaver_SSPI_Test.mp4

@uslss
Copy link
Member

uslss commented Aug 18, 2022

SSPI authentication is implemented in EE version. Could you check if it works for you?
image

@srnsomu
Copy link
Author

srnsomu commented Aug 18, 2022

Hi @uslss, I am using the Community Edition. Is PostgreSQL SSPI only available in the Enterprise Edition?

@emironovDB emironovDB assigned serge-rider and unassigned uslss Aug 23, 2022
@emironovDB emironovDB assigned uslss and unassigned serge-rider Sep 5, 2022
@emironovDB emironovDB modified the milestones: 22.2.0, 22.2.1 Sep 5, 2022
@uslss
Copy link
Member

uslss commented Sep 7, 2022

Cannot reproduce it for now. @srnsomu Is it reproducible for you against 22.2.0 version?

@srnsomu
Copy link
Author

srnsomu commented Sep 7, 2022

I was unaware that the SSPI authentication was not available in the Community edition. The issue can be closed

@srnsomu srnsomu closed this as completed Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants