For the complete documentation index, see llms.txt. This page is also available as Markdown.

Basic with a database

Basic authentication with a database.

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==

Database setup

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.

Login experience

When accessing Datashare, the browser prompts with its native basic-auth popup:

Screenshot of an 'authentication required' window with username and password fields and 'Cancel' and 'OK' buttons
basic auth popup

There is no sign-out: users remain logged in until the browser is closed.

Example

Launching Datashare with Docker and the basic-auth filter backed by the database:

Last updated