I have Keycloak v23 running in a docker container, I use Postman to create the environment I need in keycloak. I have successfully configured OTP in the Keycloak UI admin console and now want to replicate that process using API calls so no further configuration is needed in the UI whenever I bootstrap my system.
To configure OTP I essentially followed this guide: Keycloak MFA using Mobile Authenticator Setup | by Bhuvanesh Kamaraj | Medium
I am stuck now at the step where I add the Conditional OTP to the browser_otp_flow.
I’m attempting to hit: {{setup_keycloak_server}}/admin/realms/{{realm}}/authentication/flows/browser_otp_flow/executions
With the body:
{
“requirement”: “REQUIRED”,
“displayName”: “Conditional OTP Form”,
“alias”: “browser_otp_flow_alias”,
“description”: “OTP Flow”,
“requirementChoices”: [
“REQUIRED”,
“ALTERNATIVE”,
“DISABLED”
],
“configurable”: true,
“authenticationFlow”: true,
“providerId”: “auth-conditional-otp-form”,
“authenticationConfig”: {{browser_otp_flow}},
“flowId”: {{browser_otp_flow_forms}},
“level”: 1,
“index”: 1
}
but get:
{
“error”: “invalid_request”
}
I find it challenging navigating the keycloak API documentation and have hit a brick wall, any guidance would be greatly appreciated