adorsys / keycloak-config-cli

Import YAML/JSON-formatted configuration files into Keycloak - Configuration as Code for Keycloak.
Apache License 2.0
703 stars 132 forks source link

authenticatorConfig is ignored #1084

Open MBA-aix opened 4 days ago

MBA-aix commented 4 days ago

Current Behavior

I manually configured keycloak, including the setting in this screen

Screenshot from 2024-07-01 11-30-37

which is important for my stuff to work. Then I exported the config via kc.sh export and got the config file in JSON format. This file contains the following section, where I assume the above screen is stored

  "authenticatorConfig": [
    {
      "alias": "keycloak-us-oidc",
      "config": {
        "defaultProvider": "keycloak-us-oidc"
      },
      "id": "d863d33c-de7a-4649-a005-54d6b424f664"
    }
  ],

but when this configuration is applied during the next deployment, somehow that configuration seems to be missing.

Screenshot from 2024-07-01 11-30-56

Expected Behavior

I expect the exported authenticatorConfig configuration applied again to lead to the exact same resulting configuration (in the UI) again.

Steps To Reproduce

No response

Environment

Anything else?

No response

jonasvoelcker commented 4 days ago

Hi @MBA-aix,

the tool works without IDs, you just have to put the alias (keycloak-us-oidc) into the field authenticatorFlow.

Please let us know if that worked.

Best Regards Jonas

MBA-aix commented 3 days ago

Hi @jonasvoelcker,

first and foremost, that did the trick! I removed the id fields and everything works as expected.

Just one more question: Is your statement about IDs universal, i.e. there should not be any such "id": "<uuid>" properties in the config export or is this only true for the authenticatorConfig part?

Thanks in advance!

jonasvoelcker commented 3 days ago

Hey @MBA-aix,

whereever references are used (e.g. authFlowOverrides) it uses the names instead of the IDs as they are generated by Keycloak and they are not equal through the different stages.

You can easily delete every id-row in your export, you just need to reference without the IDs though.