Before proceeding with this guide, verify that the keycloak instance is already up and running
Log in as admin to the Keycloak Admin Console keycloak console using credentials available in ansible-logs/default_credentials.yaml
Change Realm to EnterpriseRAG Navigate to Authentication → Flows.
- Click on Browser under the Authentication Flows list.
- In the Authentication Flow tree, look for the "browser Conditional OTP" step.If it is not present, add it by clicking "Add Step" and selecting "Conditional OTP Form".
- Set the Browser Conditional OTP and OTP Form execution to "REQUIRED".
- Navigate to Authentication → Policies → OTP Policy.
- Modify the settings as needed:
- OTP Type: TOTP (Time-based OTP)
- OTP Hash Algorithm: Choose SHA-256
- Number of Digits: 6 (default)
- Look Ahead Window: 1 (default)
- OTP Token Period: 30 seconds (default)
- Supported Applications: Ensure
Google Authenticatoris selected.
- Navigate to Authentication → Required Actions.
- Click Configure OTP and set it to "Enabled".
- Check "Default Action" if you want all users to be required to configure MFA at their next login.(Optional)
- Make sure all the above steps are followed already before we validate the below steps.
- When the next time users log in, they will be prompted to set up an OTP device.
- Follow the complete instructions for MFA shown in the screen
Once the Google Authenticator is setup, it will generate 6 digits code that you need to prompt to login.




