keycloakify: Unable to use messagesPerField existsError and get

Hello,

I’m glad that you introduced messagesPerField.exists and messagesPerField.get in the new keycloakify v2.4.0 ! Though, I’m unable to use it. Looking at the code, it seems that if I have no profile.attributes in my configuration. I don’t know if that’s necessary as I would like to use it on classic fields such as userLabel, username, email, firstName, lastName, password and password-confirm.

I’m not sure if this is a bug or whether it is intended. I would be happy if you could update the lib for it to iterate on those values at least.

Cheers!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @loki344,
I added those fields and released a new version (5.9.0) to enable you do move forward with this but note that in the upcoming Keycloakify v6 I will remove them and you would have instead to declare them in the package.json like:

    "keycloakify": {
        "extraPages": [
            "my-extra-page-1.ftl",
            "my-extra-page-2.ftl"
        ],
        "customUserAttributes": [ 
               "dateOfBirth", 
               "country", 
               "acceptedTermsAndConditions" 
         ]
    },

Maybe it’s best if you add them right away since it wont be mentioned in the v5 to v6 migration guide.

@Romcol @dragonworr Since Keycloakify 7.13, it’s no longer needed to provide extaFields.
Keycloakify predicts the fieldNames from usage. https://docs.keycloakify.dev/build-options#customuserattributes

Hi @loki344, I added those fields and released a new version (5.9.0) to enable you do move forward with this but note that in the upcoming Keycloakify v6 I will remove them and you would have instead to declare them in the package.json like:

    "keycloakify": {
        "extraPages": [
            "my-extra-page-1.ftl",
            "my-extra-page-2.ftl"
        ],
        "extraFields": [ 
               "user.attributes.dateOfBirth", 
               "user.attributes.country", 
               "user.attributes.acceptedTermsAndConditions" 
         ]
    },

Maybe it’s best if you add them right away since it wont be mentioned in the v5 to v6 migration guide.

Will this version be available via https://www.npmjs.com/package/keycloakify ?

After months, this build option has finally been released.

You’re the man! Greetings from Switzerland!

Wow thank you very much for your support!!

Hi @blzzz

You need to use the name directly as such messagesPerField.existsError("dateOfBirth"). You can check the source code of the page for better understanding 😃

Good luck

Ok noted, this is very much work in progress I just pushed that in the rush yesterday night for those who would need this supported ASAP but a much bigger update is coming this week end