Hello everyone,
I am a third-year computer science apprentice, and I am working on a project using Keycloak 22.0.4 with Postgres. Since I have never worked with Java before, I am learning as I progress on this project.
As part of this project, I have been asked to add attributes/information about users that they provide during their registration (e.g., gender). I have already figured out how to add fields to the form using the documentation. However, I cannot find the value entered in the form when I search in the database. Furthermore, the documentation mentions modifying the theme of the account console. Unfortunately, I couldn’t locate any files in the Keycloak themes provided during the download to refer to existing code.
I am reaching out to you for more details on adding user attributes, storing them in the database, and modifying them in the user console.
Here is the code I added to login/register.ftl:
<div class="${properties.kcFormGroupClass!}">
<div class="${properties.kcLabelWrapperClass!}">
<label for="civility" class="${properties.kcLabelClass!}" style="margin: 0 0 0.5rem 0">${msg("civility")}</label>
</div>
<div class="${properties.kcInputWrapperClass!}">
<input type="radio" id="Madame" class="" name="civility"
value="${(register.formData.civility!'')}" autocomplete="civility"
aria-invalid="<#if messagesPerField.existsError('civility')>true</#if>" checked
style="margin:0 0.5rem 0 0.5rem"/><!-- a mettre dans un css glogal-->
<label for="Madame">${msg("miss")}</label>
<input type="radio" id="Monsieur" class="" name="civility"
value="${(register.formData.civility!'')}" autocomplete="civility"
aria-invalid="<#if messagesPerField.existsError('civility')>true</#if>" checked
style="margin:0 0.5rem 0 0.5rem"/><!-- a mettre dans un css glogal-->
<label for="Monsieur">${msg("mister")}</label> <!-- recherche le master dans la bonne langue a partir de la langue configurer pour le client et sa traduction dans des fichier message_##.properties -->
<#if messagesPerField.existsError('civility')>
<span id="input-error-civility" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
${kcSanitize(messagesPerField.get('civility'))?no_esc}
</span>
</#if>
</div>
</div>```