Skip to content

Commit

Permalink
Update keycloak realm (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzarras authored Nov 28, 2023
1 parent 4656bdb commit 6476946
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 66 deletions.
34 changes: 0 additions & 34 deletions docker-compose/keycloak/realms/pid-issuer-realm-realm.json
Original file line number Diff line number Diff line change
Expand Up @@ -1138,23 +1138,6 @@
"jsonType.label": "boolean"
}
},
{
"id": "90daa6fb-1cd3-4935-90fa-04a1427df4e9",
"name": "Place Of Birth",
"protocol": "openid-connect",
"protocolMapper": "oidc-usermodel-attribute-mapper",
"consentRequired": false,
"config": {
"aggregate.attrs": "false",
"userinfo.token.claim": "true",
"multivalued": "false",
"user.attribute": "place_of_birth",
"id.token.claim": "false",
"access.token.claim": "false",
"claim.name": "place_of_birth",
"jsonType.label": "JSON"
}
},
{
"id": "27a29370-a2a6-4e8c-8378-6d4999ac092e",
"name": "picture",
Expand Down Expand Up @@ -1327,23 +1310,6 @@
"jsonType.label": "boolean"
}
},
{
"id": "c8395e40-a5f8-4983-ba39-ca8689bdfcbd",
"name": "Place Of Birth",
"protocol": "openid-connect",
"protocolMapper": "oidc-usermodel-attribute-mapper",
"consentRequired": false,
"config": {
"aggregate.attrs": "false",
"userinfo.token.claim": "true",
"multivalued": "false",
"user.attribute": "place_of_birth",
"id.token.claim": "false",
"access.token.claim": "false",
"claim.name": "place_of_birth",
"jsonType.label": "JSON"
}
},
{
"id": "9cda1d0b-2413-4bc5-aef0-14860e042c6b",
"name": "picture",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
gender=Gender
gender_not_known=Not known
gender_male=Male
gender_female=Female
gender_not_applicable=Not applicable
birthdate=Birthdate
age_over_18=Age over 18
place_of_birth=Place of Birth
age_over_18_yes=Yes
age_over_18_no=No
profile=Profile
picture=Picture
credentials=Credentials
Expand Down
46 changes: 15 additions & 31 deletions docker-compose/keycloak/themes/pid-issuer/login/register.ftl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<#import "template.ftl" as layout>
<#import "register-commons.ftl" as registerCommons>
<@layout.registrationLayout displayMessage=!messagesPerField.existsError('firstName','lastName','user.attributes.gender','user.attributes.birthdate','user.attributes.place_of_birth','user.attributes.age_over_18','user.attributes.picture','user.attributes.street','user.attributes.locality','user.attributes.region','user.attributes.postal_code','user.attributes.country','user.attributes.formatted','username','password','password-confirm','termsAccepted'); section>
<@layout.registrationLayout displayMessage=!messagesPerField.existsError('firstName','lastName','user.attributes.gender','user.attributes.birthdate','user.attributes.age_over_18','user.attributes.picture','user.attributes.street','user.attributes.locality','user.attributes.region','user.attributes.postal_code','user.attributes.country','user.attributes.formatted','username','password','password-confirm','termsAccepted'); section>
<#if section = "header">
${msg("registerTitle")}
<#elseif section = "form">
Expand Down Expand Up @@ -52,11 +52,14 @@
<label for="user.attributes.gender" class="${properties.kcLabelClass!}">${msg("gender")}</label>
</div>
<div class="${properties.kcInputWrapperClass!}">
<input type="text" id="user.attributes.gender" class="${properties.kcInputClass!}" name="user.attributes.gender"
value="${(register.formData['user.attributes.gender']!'')}"
aria-invalid="<#if messagesPerField.existsError('user.attributes.gender')>true</#if>"
/>

<select id="user.attributes.gender" class="${properties.kcInputClass!}" name="user.attributes.gender"
value="${(register.formData['user.attributes.gender']!'')}"
aria-invalid="<#if messagesPerField.existsError('user.attributes.gender')>true</#if>">
<option value="0" aria-label="${msg("gender_not_known")}">${msg("gender_not_known")}</option>
<option value="1" aria-label="${msg("gender_male")}">${msg("gender_male")}</option>
<option value="2" aria-label="${msg("gender_female")}">${msg("gender_female")}</option>
<option value="3" aria-label="${msg("gender_not_applicable")}">${msg("gender_not_applicable")}</option>
</select>
<#if messagesPerField.existsError('user.attributes.gender')>
<span id="input-error-user.attributes.gender" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
${kcSanitize(messagesPerField.get('user.attributes.gender'))?no_esc}
Expand Down Expand Up @@ -92,11 +95,12 @@
<label for="user.attributes.age_over_18" class="${properties.kcLabelClass!}">${msg("age_over_18")}</label>
</div>
<div class="${properties.kcInputWrapperClass!}">
<input type="text" id="user.attributes.age_over_18" class="${properties.kcInputClass!}" name="user.attributes.age_over_18"
value="${(register.formData['user.attributes.age_over_18']!'')}"
aria-invalid="<#if messagesPerField.existsError('user.attributes.age_over_18')>true</#if>"
/>

<select id="user.attributes.age_over_18" class="${properties.kcInputClass!}" name="user.attributes.age_over_18"
value="${(register.formData['user.attributes.age_over_18']!'')}"
aria-invalid="<#if messagesPerField.existsError('user.attributes.age_over_18')>true</#if>">
<option value="true" aria-label="${msg("age_over_18_yes")}">${msg("age_over_18_yes")}</option>
<option value="false" aria-label="${msg("age_over_18_no")}">${msg("age_over_18_no")}</option>
</select>
<#if messagesPerField.existsError('user.attributes.age_over_18')>
<span id="input-error-user.attributes.age_over_18" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
${kcSanitize(messagesPerField.get('user.attributes.age_over_18'))?no_esc}
Expand All @@ -106,26 +110,6 @@
</div>
<!-- /age_over_18 -->

<!-- place_of_birth -->
<div class="${properties.kcFormGroupClass!}">
<div class="${properties.kcLabelWrapperClass!}">
<label for="user.attributes.place_of_birth" class="${properties.kcLabelClass!}">${msg("place_of_birth")}</label>
</div>
<div class="${properties.kcInputWrapperClass!}">
<input type="text" id="user.attributes.place_of_birth" class="${properties.kcInputClass!}" name="user.attributes.place_of_birth"
value="${(register.formData['user.attributes.place_of_birth']!'')}"
aria-invalid="<#if messagesPerField.existsError('user.attributes.place_of_birth')>true</#if>"
/>

<#if messagesPerField.existsError('user.attributes.place_of_birth')>
<span id="input-error-user.attributes.place_of_birth" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
${kcSanitize(messagesPerField.get('user.attributes.place_of_birth'))?no_esc}
</span>
</#if>
</div>
</div>
<!-- /place_of_birth -->

<!-- picture -->
<div class="${properties.kcFormGroupClass!}">
<div class="${properties.kcLabelWrapperClass!}">
Expand Down

0 comments on commit 6476946

Please sign in to comment.