dbeaver / dbeaver/dbeaver

Persistent Authentication form for YDB Connection on Windows (Service Account Key Auth)

Open
#37,766 3 comments 3 reactions 0 assignees View on GitHub
regression xf:auth xo:windows
Dominant language
Java
Stars
51.8k
Forks
4.4k
Avg merge
3d 13h
Merged PRs (30d)
183

Description

### Description

When connecting to YDB via the JDBC driver in DBeaver on Windows, the "Database Native Authentication" dialog repeatedly appears, requiring empty username/password fields. This occurs despite configuring a valid service account JSON key and setting security.authentication=2. The issue does not happen on macOS with identical settings.
All

![Image](https://github.com/user-attachments/assets/df485f05-609c-4a7f-923a-e31b99623aa5)

![Image](https://github.com/user-attachments/assets/ffab236c-e4a9-45f0-8871-2b07bfe24678)

### DBeaver Version

Community Edition 24.2.4

### Operating System

Windows 10 Pro

### Database and driver

**Database:** Yandex DataBase Cloud
**Driver:** [https://github.com/ydb-platform/ydb-jdbc-driver](https://github.com/ydb-platform/ydb-jdbc-driver)
**JDBC URL:**
`jdbc:ydb:grpcs://ydb.serverless.yandexcloud.net:2135/ru-central1/[...]?saKeyFile=C:/path/key.json&security.authentication=2 `
**Properties:**
```
saKeyFile = C:/path/key.json
security.authentication = 2
useSSL = true
```

### Steps to reproduce

**Steps to Reproduce**:

1. **Configure YDB Connection in DBeaver**:
- Open DBeaver and create a new YDB connection.
- Set the **JDBC URL** to:
```
jdbc:ydb:grpcs://ydb.serverless.yandexcloud.net:2135/ru-central1/b1g7ou5btr172s6c1l5i/etn6ac9r8t3hiijrq617?saKeyFile=C:/projects/authorized_key.json&security.authentication=2
```
- Leave the **Username** and **Password** fields empty.
- In the **Driver Properties** tab, set:
```
saKeyFile = C:/projects/authorized_key.json
useSSL = true
security.authentication = 2
```
- Check "Save password locally" (even though fields are empty).

2. **Test the Connection**:
- Click "Test Connection".
- When the "Database Native Authentication" dialog appears:
- Leave **User name** and **Password** fields empty.
- Click "OK".

3. **Observe the Authentication Dialog**:
- The connection succeeds, but the authentication dialog reappears:
- After re-opening the connection.
- During subsequent queries or metadata refreshes.
- Randomly during idle sessions.

4. **Test on Another Windows Machine**:
- Repeat steps 1–3 on a **different Windows PC** with the same configuration.
- **Result**: Authentication dialog persists, confirming the issue is not machine-specific.

5. **Observe Persistent Behavior Over Time**:
- Leave the connection open and idle for 5–10 minutes.
- Attempt to close DBeaver or disconnect.
- **Result**: Multiple authentication dialogs appear in quick succession, requiring repeated clicks to dismiss.

---

**Additional Notes**:
- **Workarounds Attempted (No Success)**:
- Editing `connections-config.xml` to force `auth-model="no-auth"`.
- Setting the environment variable `YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS`.
- Using forward slashes (`/`) and URL-encoding spaces in the JSON key path.
- Updating DBeaver and the YDB driver to the latest versions.

- **Expected Consistency**:
- On macOS, the same configuration works without authentication prompts.
- Windows behavior should mirror macOS (no prompts when using service account keys).

---

This should help developers replicate the issue and understand its scope.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.