# 4.10 User Profile – Custom Attributes

ZTrust allows administrators to extend the default user profile by adding **custom attributes** such as *Employee ID*, *Department*, or *Phone Number*.

With the **User Profile feature** you can:

* Define attributes at the **realm level** with validation rules.
* Control whether fields are **mandatory, optional, or read-only**.
* Decide where attributes appear: **Admin Console, Self Service Portal, Registration form**.
* Ensure **data consistency and validation** across all users.

## Steps to Create Custom Attributes

1. Login to the **ZTrust Admin Console**.

   <figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2FcBeurj2seHHyjHEbubBw%2Fimage.png?alt=media&#x26;token=c6cab900-db4a-46f5-88f5-02d9ee9bc8ed" alt=""><figcaption><p>Fig 4.10.a: Master realm</p></figcaption></figure>
2. Click on **Manage Realms** in the sidebar to view the list of realms available in your **ZTrust**.

   <figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2FqbGbGnWVVkZbNbQP65XG%2Fimage.png?alt=media&#x26;token=dbb1630e-8239-4aa1-b89d-a7c15c3f30e9" alt=""><figcaption><p>Fig 4.10.b: Choose realm</p></figcaption></figure>
3. From the list of **realms**, **select** the realm where you want to create custom attributes.

   <figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2F9xDpVhnB07mPzTHez3iw%2Fimage.png?alt=media&#x26;token=c17ec7e6-af19-40de-b29d-61c9268155b3" alt=""><figcaption><p>Fig 4.11.c: Welcome to demo realm</p></figcaption></figure>
4. In the left sidebar, under the **Configure** section, choose **Realm Settings**.

   <figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2FbsamQ1Oht4QM3mUO0Cce%2Fimage.png?alt=media&#x26;token=c8200eae-a0c6-4794-9fa2-fdadbb20877b" alt=""><figcaption><p>Fig 4.10.d: Realm settings in side bar</p></figcaption></figure>
5. In the R**ealm Settings** section, click on the **User Profile** tab. This will display the list of available attributes.

   <figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2FGsAkBzhPMR6jnSs2nYJL%2Fimage.png?alt=media&#x26;token=55cd441c-fc9b-4f5a-97b5-c68447032871" alt=""><figcaption><p>Fig 4.10.e: Select user profile tab</p></figcaption></figure>
6. To create a new custom attribute, click on the ***Create Attribute*** button. This will open a new page.

   <figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2FzBxw94atjKCSrmsfZxWy%2Fimage.png?alt=media&#x26;token=91f5e132-b068-4b0e-80e0-15c131e6f7dd" alt=""><figcaption><p>Fig 4.10.f: Create attribute</p></figcaption></figure>
7. Configure the attribute:

   | Field            | Description                                                                                                                                                                                                            |
   | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | Name             | Internal key (e.g., `employeeId`)                                                                                                                                                                                      |
   | **Display Name** | User-friendly label (e.g., *Employee ID*)                                                                                                                                                                              |
   | Required         | Mark as mandatory if needed                                                                                                                                                                                            |
   | Permissions      | <p>Choose who can view/edit : </p><ul><li><strong>Admin</strong> only</li><li><strong>User</strong> (self-service)</li><li><strong>Both</strong></li></ul>                                                             |
   | Validations      | <p>Add constraints:</p><ul><li><em>Regex</em> → e.g., <code>^\[0-9]+$</code> for numeric IDs</li><li><em>Length</em> → min/max characters</li><li><em>Options</em> → dropdown values (e.g., IT, HR, Finance)</li></ul> |
8. After filling in all the mandatory fields, click the *Create* button.

## Conclusion

User Profile attributes provide a structured way to manage custom fields. They can be customized with validations, permissions, and UI hints, and they automatically appear in the Admin Console, Self Service Portal, and Registration pages.
