Two factor authentication
Tinyauth has built-in support for TOTP, enabling the use of authenticator apps to generate 2FA codes for logging in.
Generating the Secret
Section titled “Generating the Secret”A TOTP secret must first be generated. This requires the current username:hash. Use the Tinyauth CLI to create the new user:
docker run -i -t --rm ghcr.io/steveiliop56/tinyauth:v5 totp generate --interactive./tinyauth totp generate --interactiveThe command prompts for the user and generates a QR code to scan with an authenticator app. Once added, copy the newly generated user (displayed after the user= log message) and include it in the Tinyauth user list. Restart Tinyauth to apply changes. From this point, logging in will require a TOTP code.
Verifying the User
Section titled “Verifying the User”If you want to ensure that the user is configured correctly, you can use the following command:
docker run -i -t --rm ghcr.io/steveiliop56/tinyauth:v5 user verify --interactive./tinyauth user verify --interactiveThe command prompts for the username:hash:totp, username, password, and a TOTP code from the authenticator app. If successful, a user verified message is displayed.