Skip to content

Pre-configure credentials

To connect without entering credentials interactively, add them directly to data-sources.json before starting dbvr.

Warning

Credentials in data-sources.json are stored in plain text until the first connection. Make sure no unauthorized users have access to the workspace config files during this time.

Steps

  1. Open <workspace>/General/.dbeaver/data-sources.json.
  2. Add an auth-properties object inside the connection's configuration:
"auth-model": "native",
"auth-properties": {
  "userName": "postgres",
  "userPassword": "secret"
}
  1. Set "save-password": true at the top level of the connection entry.
  2. Start dbvr and open the connection for the first time.
  3. dbvr encrypts the credentials and removes them from data-sources.json. The connection will authenticate automatically from now on.

The field names in auth-properties depend on the auth model. To see the available models and their parameters for your driver, run:

dbvr auth-models --driver=<driver-id>

Info

For common auth models and example parameters, see Auth model reference.

Example

Full data-sources.json with pre-configured credentials for PostgreSQL:

Example

{
  "folders": {},
  "connections": {
    "postgres-jdbc-test": {
      "provider": "postgresql",
      "driver": "postgres-jdbc",
      "name": "PostgreSQL_test",
      "save-password": true,
      "configuration": {
        "host": "localhost",
        "port": "5432",
        "database": "postgres",
        "url": "jdbc:postgresql://localhost:5432/postgres",
        "configurationType": "MANUAL",
        "type": "dev",
        "auth-model": "native",
        "auth-properties": {
          "userName": "postgres",
          "userPassword": "postgres"
        }
      }
    }
  }
}