Authentication and User Management

How to Add Custom LDAP Fields to the UI

To add a custom LDAP fields to the User interface you have to:

  1. Create a custom schema based on nuxeo's user.xsd schema with custom fields related to the fields in your LDAP system.


     <?xml version="1.0"?>
     <xs:schema xmlns:xs=""
      <xs:include schemaLocation="base.xsd" />
      <xs:element name="username" type="xs:string" />
      <xs:element name="password" type="xs:string" />
      <xs:element name="email" type="xs:string" />
      <xs:element name="firstName" type="xs:string" />
      <xs:element name="lastName" type="xs:string" />
      <xs:element name="company" type="xs:string" />
      <!-- your custom telephone field -->
      <xs:element name="telephone" type="xs:string" />
      <xs:element name="groups" type="nxs:stringList" />

  2. Add your schema via Nuxeo's extension system.


     <?xml version="1.0"?>
     <component name="com.example.myproject.myuser.schema">
      <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
        <schema name="myuser" src="schemas/myuser.xsd" />

  3. Modify your LDAP configuration file in Nuxeo (default-ldap-users-directory-bundle.xml) to include:

    1. your custom schema,


        <extension target=""
          <directory name="userDirectory">
            <!-- association between your custom schema and the directory -->

    2. mapping between your schema and your LDAP fields.

      default-ldap-users-directory-bundle.xml (continued)

            <fieldMapping name="username">uid</fieldMapping>
            <fieldMapping name="password">userPassword</fieldMapping>
            <fieldMapping name="firstName">givenName</fieldMapping>
            <fieldMapping name="lastName">sn</fieldMapping>
            <fieldMapping name="company">o</fieldMapping>
            <fieldMapping name="email">mail</fieldMapping>
            <fieldMapping name="telephone">telephoneNumber</fieldMapping>

  4. Modify the UI.

    1. Add your custom widget to the layout.


       <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
          <layout name="user">
              <template mode="any">/layouts/layout_default_template.xhtml</template>
            <!-- your custom telephone widget-->

    2. Define a new widget for your custom field to be used in the layout above.


       <widget name="telephone" type="text">
       <label mode="any">telephone</label>
       <field schema="myuser">telephone</field>
       <mode value="editPassword">hidden</mode>
       <properties widgetMode="edit">
       <property name="required">true</property>
       <property name="styleClass">dataInputText</property>




2 months ago Andrew Goodricke Syntax error fixed
3 years ago Solen Guitter 11
5 years ago Solen Guitter 10
5 years ago Solen Guitter 9
6 years ago Solen Guitter 8
6 years ago Solen Guitter 7 | Added related pages
9 years ago Florent Guillaume 5
9 years ago Florent Guillaume 6 | Migrated to Confluence 4.0
9 years ago Wojciech Sulejman 4
9 years ago Wojciech Sulejman 3
9 years ago Wojciech Sulejman 2
9 years ago Wojciech Sulejman 1
History: Created by Wojciech Sulejman

We'd love to hear your thoughts!

All fields required