Skip to content

Commit

Permalink
Removes profile and email from registration form (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzarras authored Nov 20, 2023
1 parent 5a167f8 commit 50846fb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 77 deletions.
36 changes: 1 addition & 35 deletions docker-compose/keycloak/realms/pid-issuer-realm-realm.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"registrationEmailAsUsername": false,
"rememberMe": false,
"verifyEmail": false,
"loginWithEmailAllowed": true,
"loginWithEmailAllowed": false,
"duplicateEmailsAllowed": false,
"resetPasswordAllowed": false,
"editUsernameAllowed": false,
Expand Down Expand Up @@ -1153,23 +1153,6 @@
"jsonType.label": "JSON"
}
},
{
"id": "572f1388-58ed-4e42-90ce-236617bbeac0",
"name": "profile",
"protocol": "openid-connect",
"protocolMapper": "oidc-usermodel-attribute-mapper",
"consentRequired": false,
"config": {
"aggregate.attrs": "false",
"userinfo.token.claim": "true",
"multivalued": "false",
"user.attribute": "profile",
"id.token.claim": "false",
"access.token.claim": "false",
"claim.name": "profile",
"jsonType.label": "String"
}
},
{
"id": "27a29370-a2a6-4e8c-8378-6d4999ac092e",
"name": "picture",
Expand Down Expand Up @@ -1359,23 +1342,6 @@
"jsonType.label": "JSON"
}
},
{
"id": "c1075001-f8d9-47ce-8bbb-22d108ffbec5",
"name": "profile",
"protocol": "openid-connect",
"protocolMapper": "oidc-usermodel-attribute-mapper",
"consentRequired": false,
"config": {
"aggregate.attrs": "false",
"userinfo.token.claim": "true",
"multivalued": "false",
"user.attribute": "profile",
"id.token.claim": "false",
"access.token.claim": "false",
"claim.name": "profile",
"jsonType.label": "String"
}
},
{
"id": "9cda1d0b-2413-4bc5-aef0-14860e042c6b",
"name": "picture",
Expand Down
42 changes: 1 addition & 41 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.profile','user.attributes.picture','user.attributes.street','user.attributes.locality','user.attributes.region','user.attributes.postal_code','user.attributes.country','user.attributes.formatted','email','username','password','password-confirm','termsAccepted'); section>
<@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>
<#if section = "header">
${msg("registerTitle")}
<#elseif section = "form">
Expand Down Expand Up @@ -126,26 +126,6 @@
</div>
<!-- /place_of_birth -->

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

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

<!-- picture -->
<div class="${properties.kcFormGroupClass!}">
<div class="${properties.kcLabelWrapperClass!}">
Expand Down Expand Up @@ -289,26 +269,6 @@
<!-- /formatted -->

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

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

<!-- username -->
<#if !realm.registrationEmailAsUsername>
<div class="${properties.kcFormGroupClass!}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,5 @@ private data class UserInfo(
@SerialName("gender") val gender: UInt? = null,
@SerialName(OidcAssurancePlaceOfBirth.NAME) val placeOfBirth: OidcAssurancePlaceOfBirth? = null,
@SerialName("age_over_18") val ageOver18: Boolean? = null,
val profile: String? = null,
val picture: String? = null,
)

0 comments on commit 50846fb

Please sign in to comment.