Basic with a database
Basic authentication with a database.
Last updated
Basic authentication with a database.
This filter is superseded by the HTML form auth filter, which offers a nicer login experience and supports sign-out. It is the recommended way to authenticate users backed by the database. This page is kept for reference and existing deployments.
Basic authentication is a simple protocol that uses HTTP headers and the browser to authenticate users. User credentials are sent to the server in the Authorization header with user:password base64-encoded:
Authorization: Basic dXNlcjpwYXNzd29yZA==Credentials are sent in plain text (base64 is not encryption). Always run Datashare behind TLS when using this filter.
On the server side, you need to provide a database user inventory. Launching Datashare first with the full database URL will automatically migrate the schema. Datashare supports SQLite and PostgreSQL. SQLite is not recommended for multi-user servers because it cannot be multithreaded and will cause contention on user lookups.
See Provisioning users for how to hash passwords, structure user records, and insert them into the user_inventory table.
When accessing Datashare, the browser prompts with its native basic-auth popup:

There is no sign-out: users remain logged in until the browser is closed.
Launching Datashare with Docker and the basic-auth filter backed by the database:
Last updated
docker run -ti ICIJ/datashare --mode SERVER \
--batchQueueType REDIS \
--dataSourceUrl 'jdbc:postgresql://postgres/datashare?user=<username>&password=<password>' \
--sessionStoreType REDIS \
--auth basic \
--authUsersProvider database