Skip to main content
xorlab Security Platform users can be authenticated using a static password file. Similarly to LDAP-based authentication, the configuration of the backend is defined in the fileAuthDataSources: subsection of the usernamePasswordAuthBackends: section in the auth/auth/auth.yml file.
Before you start configuring this backend, please read the Authentication article, if you haven’t already.
Generally, we don’t recommend this authentication method as it’s more vulnerable than the others, e.g., it is prone to credential abuse and doesn’t allow 2FA. If you really need to use it, please make sure to follow these two principles:
  • Use secure passwords or passphrases, i.e., make them unique, random, and long; preferably create them in a password generator of your favorite password manager or use an online service like Bitwarden.
  • Don’t share accounts.

Enable Logging

With this authorization method, it’s good to know whether there were any unsuccessful login attempts. You can use the logging system for that:
  1. Follow the instructions for logging audit trail events to create a log for the audit.access.denied event.
  2. Your auth/auth/logback-audit.xml config file should look like the one below:
If you want to log all login attempts—both unsuccessful and successful—just change the logger name value to "audit.access".

Basic Configuration

The following configuration example shows how to enable this option:
In this example, we defined the examplePassword backend, then we configured it under the usernamePasswordAuthBackends: section:
  • in the enabledAuthDataSources key, we set the only source of auth data to passwordFile, then
  • in the file key for this source under fileAuthDataSources, we pointed to the passwordFile.yml file which contains the password.

Password file

Using Expert Editor, open the default passwordFile.yml located in auth/auth/ and edit it. Use the example below to create your own password file:
All users are listed under the users: section and their available attributes are explained in the table below:

Password hash generator

  1. Run the docker exec -it auth_auth create_hash command on the XCC terminal to generate a password hash from the password you enter and re-type when prompted. You should get the output similar to the one below:
  2. Copy the generated hash, open Expert Editor and paste it into auth/auth/passwordFile.yml as a value for the passwordHash key of a particular user.
  3. Once you finish adding password hashes for all users, click PUBLISH to deploy changes. After one minute, the changes will be hot-reloaded and active.
In case you don’t have access to the XCC terminal, run htpasswd -nBC 10 ignore | sed 's/ignore:/{bcrypt}/' on a Linux terminal to generate a password hash as alternative to step 1 above.

Multi-Tenant Configuration

Please refer to Multi-Tenant Password Authentication for instruction on how to configure password file-based authentication in a multi-tenant environment.