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.
- 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:-
Follow the instructions for logging audit trail events to create a log for the
audit.access.deniedevent. -
Your
auth/auth/logback-audit.xmlconfig file should look like the one below:
logger name value to "audit.access".
Basic Configuration
The following configuration example shows how to enable this option:examplePassword backend, then we configured it under the usernamePasswordAuthBackends: section:
- in the
enabledAuthDataSourceskey, we set the only source of auth data topasswordFile, then - in the
filekey for this source underfileAuthDataSources, we pointed to thepasswordFile.ymlfile which contains the password.
Password file
Using Expert Editor, open the defaultpasswordFile.yml located in auth/auth/ and edit it. Use the example below to create your own password file:
users: section and their available attributes are explained in the table below:
Password hash generator
- Run the
docker exec -it auth_auth create_hashcommand 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: - Copy the generated hash, open Expert Editor and paste it into
auth/auth/passwordFile.ymlas a value for thepasswordHashkey of a particular user. - 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.
htpasswd -nBC 10 ignore | sed 's/ignore:/{bcrypt}/' on a Linux terminal to generate a password hash as alternative to step 1 above.