Keycloak
Example Custom Authenticator
-
First, Keycloak must be running. See Getting Started, or you can build distribution from source.
-
Execute the follow. This will build the example and deploy it
$ mvn clean install wildfly:deploy -
Copy the
andsecret-question.ftl
files to thesecret-question-config.ftl
server directory.themes/base/login -
Login to admin console. Hit browser refresh if you are already logged in so that the new providers show up.
-
Go to the Authentication menu item and go to the Flows tab, you will be able to view the currently defined flows. You cannot modify a built-in flows, so, to add the Authenticator you have to copy an existing flow or create your own. Copy the "Browser" flow.
-
In your copy, click the Actions menu item in Forms subflow and Add Execution. Pick
and change the Requirement choice.Secret Question -
Go to the Bindings tab in Authentication menu and change the default Browser Flow to your copy of the browser flow and click
.Save -
Next you have to register the required action that you created. Click on the Required Actions tab in the Authentication menu. Click on the
button and choose your new Required Action. You can also choose theRegister
for the Required Action and each new user has to set the secret answer. Your new required action should now be displayed and enabled in the required actions list.Default Action