Configure username/password authentication

This guide will show you how to configure username/password authentication (sometimes referred to as 'basic authentication') for Deephaven. SQL is used to store the username/password combinations. This guide will set up one admin user.

Setup

Setting up username/password authentication requires the configuration of a SQL database, which will be run by Docker alongside Deephaven. Additionally, a JAR to manage the authentication will be added to the Deephaven classpath, and an extra configuration parameter will be specified in the docker-compose YAML file.

SQL

The following SQL file will create a database with a single table (users), in the deephaven_username_password_auth schema. It has a single entry for a user named admin with the password p@ssw0rd.

Dockerfile

The Dockerfile will add a required JAR file to the Deephaven classpath. This JAR file contains all the nuts and bolts necessary for username/password authentication through SQL.

docker-compose.yml

Lastly, create the docker-compose.yml. It will create two services: postgres and deephaven.

Warning

The file below sets the admin password for the SQL database containing login information to password for example purposes. We recommend storing passwords more securely. See Manage sensitive data with Docker secrets for more information.

Start Deephaven

Start Deephaven with docker compose up --build, head to https://localhost:10000/ide, and enter the username/password combo to start writing queries.