# Configuration as code and registration workflows

**URL:** <https://forum.keycloak.org/t/configuration-as-code-and-registration-workflows/23581>\
**Category:** Getting advice\
**Created:** [December 5, 2023, 3:33pm UTC](https://forum.keycloak.org/t/configuration-as-code-and-registration-workflows/23581 "2023-12-05T15:33:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![smaly](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@smaly](https://forum.keycloak.org/u/smaly)\
**Post date:** [December 5, 2023, 3:33pm UTC](https://forum.keycloak.org/t/configuration-as-code-and-registration-workflows/23581/1 "2023-12-05T15:33:37Z")

</div>

I attended a workshop at WJAX 2023 with dasniko in Munich and learned some first steps in working with keycloak. Now I have two more questions since we are currently thinking about using keycloak in the future.

Is configuration as code possible and are there best practices?  
In the workshop we did a lot of manual configuration in the keycloak ui. I figure of course that one can use the rest api for the administration console. Are there ways of configuring clients, token settings, authentication workflows and so on in the yml thow or somewhere else? I guess you could allways write your own script that uses the rest api, right?

I think there is no build in implementation for a user registration workflow, or is there? You can yet again use the rest api of the administration console, right?

Sorry if i could have looked this up somewhere, i’m quite new to the topic.  
Thanks!

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [December 5, 2023, 3:54pm UTC](https://forum.keycloak.org/t/configuration-as-code-and-registration-workflows/23581/2 "2023-12-05T15:54:38Z")

</div>

> [@smaly](#):
>
> I attended a workshop at WJAX 2023 with dasniko in Munich

Great! 🙂

> [@smaly](#):
>
> Is configuration as code possible and are there best practices?

Keycloak itself does not support any configuration-as-code approach, unfortunately. But there is the [keycloak-config-cli](https://github.com/adorsys/keycloak-config-cli) which might be able to help you.

> [@smaly](#):
>
> I guess you could allways write your own script that uses the rest api, right?

Yes, that’s right. Anything you can click, you can automate is some way using the Admin REST API, as the UI also uses the REST API under the hood. There’s a java client library and a shell wrapper (`kcadm.sh`) available.

> [@smaly](#):
>
> I think there is no build in implementation for a user registration workflow, or is there?

Yes, there is! You’ll have to enable the “registration” option on the “Login” tab in the “Realm settings”, then, the link for user registration will appear on the login page.

---

<div class="post-metadata">

**Author:** ![smaly](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@smaly](https://forum.keycloak.org/u/smaly)\
**Post date:** [December 7, 2023, 8:47am UTC](https://forum.keycloak.org/t/configuration-as-code-and-registration-workflows/23581/3 "2023-12-07T08:47:18Z")

</div>

Thank you very much for the answer!  
I didn’t find a way to configure which attributes should be required or optional fields for the registration. But I guess this the same configuration as in Users - Attributes, right?

---

<div class="post-metadata">

**Author:** ![tania](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/tania/32/9460_2.png) [@tania](https://forum.keycloak.org/u/tania)\
**Post date:** [May 4, 2026, 2:05pm UTC](https://forum.keycloak.org/t/configuration-as-code-and-registration-workflows/23581/4 "2026-05-04T14:05:40Z")

</div>

> [@dasniko](#):
>
> keycloak-config-cli

What are the use cases best for using keycloak-config-cli? We currently apply the configuration with Java code. If we want to change that, keycloak-config-cli or terraform, for which cases would be better?
