User Authentication
Overview⚓︎
Hydrolix provides a unified auth system for your cluster. It's enabled by default, works for externally available endpoints, and covers:
- Ingestion: HTTP Stream API
- Query: HTTP Query API, ClickHouse HTTP, ClickHouse (native), and MySQL
- Web: Hydrolix UI
- Utility and management services and endpoints like the transform validator, version, Prometheus, and others
See Authentication and Authorization for more detail.
Users with sufficient permissions may create new users and manage existing users with web UI or user management Config API calls like List users.
Authenticating to the UI⚓︎
Visit your Hydrolix cluster's IP address in a web browser to be directed to the login page if you aren't already logged in. Your browser will store an authorization token in a browser cookie and present it during your session.
Authenticate to the API⚓︎
For most Config API endpoints, only an authorization token is accepted.
The Login to Hydrolix endpoint accepts user credentials and supplies the authorization token. Clients can then present this authorization token, sometimes called a bearer token, rather than a username and password.
The authorization token is valid for access to everything permitted to the connected user account for 24 hours from issue, before the server requires reauthentication.
Retrieve an authorization token⚓︎
Retrieve an authorization token using the Login to Hydrolix endpoint.
Abridged user login response⚓︎
This example shows how the response to a user passing valid credentials should look. The response JSON has been abridged for readability.
- This type of token is usable in an HTTP
Authorizationheader of typeBearer. - This is a listing of role names. Each contains sets of permissions. See also Account Permissions (RBAC).
- Usually, enabled. An account can be permanently disabled. See Disable User.
JSON can be made more human-readable using a JSON pretty-printing utility such as jq or yq.
Example usage of an authorization token⚓︎
Fetch an authorization token and store it in $HDX_TOKEN shell variable.
Get the bearer token, which is good for the next 24 hours, to authenticate future API calls. This command assumes you've set the $HDX_HOSTNAME, $HDX_USER, and $HDX_PASSWORD environment variables:
Present the Bearer <TOKEN> in an HTTP Authorization header. This is an example query using the HTTP Query API requesting recent record count in your cluster's hydro.logs table:
If the token is invalid, the API will respond with a message like this:
Token Prefix
Don't forget the prefix Bearer.