How To
ForgeRock Identity Platform
Does not apply to Identity Cloud

How do I make individual user profile attributes read-only in AM (All versions)?

Last updated Jan 16, 2023

The purpose of this article is to provide information on making individual user profile attributes read-only in AM. You would do this if you want to prevent end users from changing certain fields shown on the User Profile page.

1 reader recommends this article

Making individual user profile attributes read-only

You can make individual user profile attributes read-only as follows:

  1. Follow the steps in Download the XUI to obtain the XUI source.
  2. Edit the UserProfileTemplate.html file (located in the /am-external/openam-ui/openam-ui-user/src/resources/themes/default/templates/user directory for AM 7 and later, or /am-external/openam-ui/openam-ui-ria/src/main/resources/templates/user directory for AM 6.x) and add readonly=true to any attributes you want to make read-only. For example, the amendments would look like this to make First Name and Last Name read-only: <div class="panel-body"> {{#user}} {{> form/_basicInput property="username" label="common.user.username" readonly=true}} {{> form/_basicInput property="givenName" label="common.user.givenName readonly=true"}} {{> form/_basicInput property="sn" label="" required="true readonly=true"}} {{> form/_basicInput type="email" property="mail" label="common.user.emailAddress" extraAttributes='data-validator="validEmailAddressFormat" data-validator-event="keyup"' }} {{> form/_basicInput type="tel" property="telephoneNumber" label="common.user.phoneNumber" extraAttributes='data-validator="validPhoneFormat" data-validator-event="keyup"'}} {{/user}} </div>
  3. Follow steps in Test and deploying the XUI to test your changes, then rebuild and deploy.

The User Profile page now shows the First Name and Last Name fields have been grayed out to indicate the values in these fields are hard-coded :

See Also

How do I make a whole user data store read-only to users in AM (All versions)?

FAQ: Customizing, branding and localizing end user pages in AM

UI customization

Related Training


Related Issue Tracker IDs


Copyright and Trademarks Copyright © 2023 ForgeRock, all rights reserved.