Skip to content

Templates

Onegini IdP Extension templates can use attributes which are provided by Onegini IdP. As a reference for customising templates please refer to the default template set (zip) and the default email template set (zip).

Registration form

In order to properly block certain fields from edit (and just to still display them for users) it's advised to keep proper th:readonly tags. Fields are associated with attribute values from following list:

SN - for surname (family name)
GIVEN_NAME
INITIALS
TELEPHONE_NUMBER
DISPLAY_NAME
PREFERRED_LANGUAGE
STREET_ADDRESS
CITY
STATE_OR_PROVINCE - for region
POSTAL_CODE
COUNTRY
POSTAL_ADDRESS
GENDER
DATE_OF_BIRTH
PLACE_OF_BIRTH
NATIONALITY
EMAIL

to pass information about required field configuration additional map of objects "fieldConfiguration" is provided. Map associates keys (mentioned above) with FieldConfiguration object that provides "isEditable" function.

example field may look like:

<input type="radio" name="gender" id="gender-m" value="M" th:field="*{gender}"
 th:value="${T(com.onegini.domain.person.attribute.Gender).M}"
 th:attr="data-msg-required=#{personal.fields.gender.error}"

 th:readonly="${#maps.containsKey(fieldConfiguration, 'GENDER') && fieldConfiguration['GENDER'].isEditable() == false}"

/>

Facebook profile attributes

Onegini IdP exposes attributes from a Facebook profile to the templates. It depends on the Facebook IdP configuration which attributes are exposed.

Identifiers of the profile attributes:

  • name
  • short_name
  • first_name
  • middle_name
  • last_name
  • address
  • email
  • gender
  • birthday

Below is an example of the HTML code to render the first_name:

<span th:text="${@idp.rawAttributes['first_name']}"></span>