Why midPoint object templates keep identity data consistent
Identity data for a single person usually arrives from several places: an HR system, a directory, a contractor register, a manual request. Each source has its own format and its own idea of a name or an account. Object templates are the midPoint mechanism that applies one set of rules to every user object, whatever its source, so the stored identity data stays internally consistent. According to the Evolveum feature page, object templates specify mappings for internal consistency, such as computing a full name from given and family names, they can assign roles automatically, and iteration determines unique values such as usernames when the preferred value is already taken.
Teams need object templates when the same derived value must be produced the same way everywhere: a display name built from name parts, a username scheme that stays unique across thousands of accounts, or a baseline role granted by department or employment type. Without a single template, those rules tend to end up duplicated in inbound mappings, scripts and manual edits, and they drift apart. Before the build starts, list every attribute that is derived rather than sourced, decide which template owns each one, and confirm with the release notes for your installed midPoint version how iteration and automatic role assignment behave, since these areas change between releases.
Object templates do not replace connector mappings, which move data between midPoint and a target system, and they do not replace approvals, which control who may request or receive access. A template decides what the identity looks like inside midPoint; a resource mapping decides what a target receives; an approval decides whether an access change proceeds. Keep these layers separate in the design document so that a change to a username rule is tested against both the template and the affected connectors, and so that automatically assigned roles still pass through the approval paths your auditors expect.
Object template options and when each fits
This table compares the object template options a team chooses between in midPoint: computed attributes, username generation with iteration, automatic role assignment, and template scope. Read each row for when the option fits, the main trade-off, and what to verify in your target release before building it.
| Template option | When it fits | Main trade-off | What to verify in the target release |
|---|---|---|---|
| Computed attributes (such as full name) | Derived values that must always match their source fields, such as display name built from given and family name | Easy to review as a mapping, but chained expressions can hide logic that is hard to trace when source data changes | Which attributes the template computes, whether values recompute on every change, and how the GUI shows computed fields |
| Username generation with iteration | Unique login names across directories where two people can share a name and collisions must resolve predictably | Iteration rules are compact but harder to audit; a naming change can alter usernames for existing accounts | How iteration is evaluated, the suffix format, and how existing accounts with conflicting names are handled before the template runs |
| Automatic role assignment | Baseline access tied to a stable attribute such as department or job code, with the same rule for every joiner | Assignments made in a template are less visible to reviewers than requested roles, so errors can spread quickly | Whether template-driven assignments appear in certification and reporting views, and how removal behaves when the condition no longer holds |
| Template scope per object type | One template per user, role or organization type when the data model differs between object kinds | More templates mean more places to change; overlapping scopes can apply conflicting mappings | How the template is linked to the object type in your release and which templates apply when several match |
| Template scope per archetype | Different identity rules for employees, contractors or service accounts that share the same object type | Archetype-specific rules are precise but multiply test cases and require archetype discipline across the team | Archetype assignment rules, the order in which templates apply, and whether changing an archetype re-runs the template |
| Template versus inbound mapping | Logic that should run on every change to the identity, regardless of which source supplied the data | Templates keep internal consistency, but source-specific rules belong in inbound mappings, so teams must agree on the boundary | Where each rule is documented, and whether a value is set by a template or by a resource mapping |
| Testing and review of template logic | Any template that drives access or usernames, where a wrong result affects many accounts | Thorough testing takes effort, and test data rarely covers every edge case in production HR feeds | Whether your environment supports simulation or preview of template results before changes are applied |
How to set up object templates in sequence
This sequence takes object templates from an agreed identity data model to a tested configuration that computes consistent attributes, generates unique usernames, and assigns roles before anything reaches production users.
Agree the identity data model and naming rules
Work with HR, the owners of each target system and the identity team to write down which attributes every identity needs, where each value comes from, and the naming rules for usernames, email addresses and display names. Include what happens with name changes, duplicate names and contractors. The step is done when the agreed rules fit on one page and each target owner has confirmed the attributes their system requires. Keep the document under version control so later template changes can be traced back to a decision.
Write template mappings for derived attributes
Build the object template in midPoint with mappings that compute derived values, such as full name from given and family name, so that identity data stays internally consistent whichever source changed it. Keep each mapping small and name it clearly, and prefer simple expressions over long scripts so reviewers can read them. Check the template's effect by running a preview on a few sample users, confirming that each computed attribute matches the value written in the naming rules.
Configure iteration for unique usernames
Set up the username mapping so that midPoint generates a base value and then uses iteration to append a counter when the value already exists in the repository or target system. Decide the maximum iteration behavior and the fallback when the pattern is exhausted, and document both. Confirm the result by creating two or three sample identities with the same name and verifying that the usernames differ predictably and that the original identity keeps its value.
Add automatic role assignment rules
Define the conditions under which the template assigns roles, such as organizational unit, job code or employment type, and link each condition to an existing role in the role model. Keep the rules limited to baseline access that the owners have approved, because automatic assignment applies to every matching identity. The check for this step is a preview showing the expected roles for each sample profile, with no role appearing for a profile that should not receive it.
Test duplicate handling on a test set
Load a controlled set of test identities that includes duplicate names, name changes, a mover and a contractor. Run the template against them and review the preview output for each object, looking at computed attributes, generated usernames and assigned roles. Record every unexpected result, correct the template, and repeat until the test set produces the outputs the naming rules specify. Keep the test set so that later template changes can be regression tested against it.
Enable the template for production with monitoring
Before enabling the template for production, confirm the change approval, the rollback approach for the template object and who owns future changes. Enable the template on a limited population first if your change process allows it, then review the first real identities it touches and the resulting target system accounts. The step is complete when the first production results match the test set outputs and the owners have signed off on the observed behavior.
How templates fit with mappings, roles and the data flow
An object template sits inside midPoint between the data that arrives from sources and the data that leaves for target systems. Inbound mappings from an HR feed or a directory bring values into midPoint's internal user object. The object template then works on that internal object, computing derived values such as a full name, a unique username or a role assignment, and enforcing consistency rules that apply no matter where a change came from. Outbound mappings, defined on the resource, then translate the internal object into the attributes a target system expects. The practical point for the team is that the template owns the identity-level logic and the resource owns the system-level logic. Before you build anything, write down which attribute is computed where, because a value calculated in two places will eventually disagree. Confirm the evaluation order for your midPoint version in the current midPoint features documentation and in your own test environment, since the order in which inbound mappings, templates and outbound mappings run determines what a later step sees.
Keep template logic free of anything a connector mapping already does. If a template builds a login name and an outbound mapping on the Active Directory resource also builds it, the two expressions can drift when one is edited and not the other, and the resource may receive a value that the template never validated. A workable rule is that the template produces the canonical value stored on the user, and each resource maps that canonical value without recalculating it. When you review a change, ask whether the expression reads from the internal object or from a target system attribute, because an expression that reads from a target system couples the template to that system's current state. Role assignment deserves the same discipline. A template that assigns a role based on attributes such as department or employment type makes that assignment a function of the data, so it should be designed alongside the role model and the lifecycle states. Check how the assignment behaves when a user moves to a new position or leaves, and whether removing the condition removes the role, since that behavior affects joiner, mover and leaver processing.
Where object templates act in the identity data flow
The flow starts at an authoritative source such as HR, where inbound mappings bring attributes into the midPoint user object. The object template then runs on that object to compute derived attributes, generate unique usernames through iteration and assign roles, before outbound mappings push the result to target connectors. Check that each derived value is produced once, in the template, and that approvals or certifications can stop a role assignment before it reaches a target system.
Object templates sit between inbound mappings and outbound provisioning in midPoint.
Security and operational considerations for template logic
Object templates run on every identity they touch, so a change to one is a change to the whole population. The cards below cover who may edit template logic, how changes are reviewed and tested, how expressions are secured, and how generated values are watched after go-live.
Who can edit templates
Object templates and the expressions inside them are configuration objects, so any administrator with rights to edit them can change how every matching identity is computed. Restrict edit rights to a small named group, separate it from people who run day-to-day user administration, and review the authorization roles that grant access to configuration objects. Ask the implementer to show which roles can open, modify and import templates in your environment.
Change control for template logic
Treat template changes like code: keep the XML objects in version control, require a second reviewer, and record the reason for each change alongside the commit. Changes made directly in the GUI bypass this trail, so decide in advance whether production edits are allowed at all. Ask how the project exports and imports configuration, and who signs off before an import into production.
Blast radius of a wrong template
A faulty mapping in an object template does not fail one user. It recomputes the attribute for every identity in scope, and a later reconciliation or recompute can push the wrong value into target systems. A wrong username pattern or role assignment can therefore reach directory, mail and application accounts at once. Before go-live, confirm how you will scope a recompute, pause synchronization and roll back the template object.
Expression security
Template mappings use expressions, and the expression language you choose determines what a script can reach and what it can execute. Confirm which language your release supports for object templates, whether scripts can call external services, and who may write them. Keep expressions short, avoid embedding credentials or hostnames in them, and align the choice with the expression controls in the hardening checklist.
Current featuresTesting before production
Run each template change against a copy of production data or a representative sample before it reaches the live repository. Check uniqueness results for collisions, edge cases such as names with diacritics or missing given names, and the values produced for users already in the system. Ask the implementer for a documented test set and a record of expected outputs, so a future change can be checked against the same cases.
Monitoring generated values
After go-live, watch the values the template generates: sudden spikes in iterated usernames, empty derived attributes or unexpected role assignments often signal a logic or source-data problem. Pair template output with reports on new and changed accounts, and review them after each HR feed or template change. Confirm which reports and task logs midPoint gives you and who receives the alerts.
Questions teams ask before building object templates
What drives the effort of a midPoint object template implementation?
Effort grows with the number of derived attributes, the naming rules behind them, the quality of your source data and the number of target systems that consume the results. Each derived attribute, such as a full name or email address, needs a mapping, a test case and a decision about what happens when inputs are missing. Unique username generation adds iteration logic, collision handling and a review of existing accounts. Ask any partner to break its quote down by derived attribute, naming rule and target so you can see which parts are one-time design work and which are ongoing rule changes.
Can our own identity team build object templates without a partner?
Yes, if the team already knows midPoint's configuration model and has a test environment that mirrors production data. Object templates are configuration objects, so they can be built and reviewed like other midPoint configuration. The usual gap is not the XML or expression syntax but the design work: agreeing naming rules with HR and application owners, deciding how collisions are resolved and proving the results against messy historical data. A partner is most useful for that design and for an independent review before the templates reach production.
How long does testing an object template usually take?
Testing time depends on the volume of identity data you load, the number of rules and how many edge cases your source data contains, such as duplicate names, missing fields or name changes. Plan for test runs against a copy of real data rather than a small hand-built sample, because iteration and collision behavior only shows up at scale. Evolveum does not publish a general testing duration for object templates, so ask your team or a partner to estimate it from your own record count and rule list.
What do we need from HR and application owners?
You need HR to confirm which source fields are authoritative, how names are recorded (including legal names, preferred names and changes after marriage or other life events) and what happens to identifiers when a person returns after leaving. Application owners must confirm the attribute formats their systems accept, such as maximum username length, allowed characters and email domains. Get these decisions in writing before the first template is built, because changing a naming rule later can rename accounts that other systems already depend on.
How do object templates behave during a midPoint upgrade?
Object templates are stored as configuration, so they carry through an upgrade, but their behavior can change if the expression language, mapping evaluation or the object model changes between releases. midPoint upgrades must step through supported versions, so plan a test run of your templates on each target release before the production upgrade. Compare the derived values for a representative sample before and after, and confirm the release notes for any change that affects expressions or iteration. Keep the template configuration under version control so you can see exactly what changed.
When should we bring in a partner for object templates?
Bring in a partner when the naming rules are complex, when several HR sources or target systems feed the same identity, or when the templates must be reviewed by auditors or security teams before go-live. A partner is also useful when your internal team has no recent midPoint delivery experience. DeployOpen plans and implements midPoint in your own infrastructure under a fixed-scope written agreement, so the deliverables, test evidence and handover are agreed before work starts and a quote follows from that scope.
Do object templates need a separate change process from other midPoint configuration?
They should follow the same change process as other midPoint configuration, with extra care because a single template change can alter values across every identity. Review changes through your normal source control workflow, test them against a production-like copy and record who approved each naming rule. Treat template edits as high impact changes that need a rollback plan, since a bad derived value can propagate to target systems during the next synchronization run.
Where to read the feature definition and release status
Before a design review, read the object template definition in the Evolveum documentation and confirm the release line you will deploy. The feature page describes what object templates do: they specify mappings that keep identity data internally consistent, such as computing a full name from given and family names, they can assign roles automatically, and iteration determines unique values such as usernames. Start with the Evolveum current features page and note which behaviors it describes as current, then compare them with the version your team will install. Treat the feature page as the description of intent, not as a substitute for testing the template in your own environment.
Next, check the midPoint releases page for supported versions before you commit any template design to a release. Confirm which line is long-term support and when its support ends, which feature releases are still within support, and when the next feature release is planned. Templates often run for years, so a design built on a release that leaves support during the project creates an upgrade task you did not budget for. Record the exact version, the Java runtime it requires, and the PostgreSQL repository version in the design record. Ask your Evolveum or implementation contact to confirm whether any template behavior you rely on, such as iteration handling or automatic role assignment, changed between your current release and the target release, because the feature page may not list every detail of that change.
How the approach differs by team and environment
A greenfield build starts with no legacy identities, so the object template can be designed as the source of truth from the first load. The main risk is designing templates around assumptions about attributes that the authoritative source has not yet confirmed, which forces rework once real data arrives. Teams usually decide the naming standard, the authoritative source attributes and the default role logic before writing any mapping.
- Naming standard first: Agree the username pattern, the handling of duplicates and the rules for name changes before the first user is created.
- Authoritative attributes: Confirm with HR or the directory owner which fields are reliable and which are free text that should not drive identifiers.
- Role assignment scope: Decide which roles the template may assign automatically and which still require a request or approval.
- Test data set: Build a representative sample of names, including hyphenated, accented and duplicate cases, before go-live.
- Ownership: Name who approves template changes so the logic does not drift between administrators.
Before build starts, check the template design with the team that will own the identity data after launch.
When usernames already exist in target systems, the template must reproduce or deliberately change them without breaking logins, mail routing or audit trails. The main risk is that a template computes a username for a person who already has one, and iteration assigns a new value that orphans the existing account. Teams need to settle how existing identifiers are read before the template is allowed to generate new ones.
- Existing identifier inventory: List every system holding usernames and confirm which value each one uses as its key.
- Pattern reconciliation: Compare the generated pattern with current usernames and document each mismatch, including people who were renamed informally.
- Iteration behavior on known names: Decide whether iteration should skip already-owned values or consult the repository first, and test that path explicitly.
- Dry run: Run the template in preview against a copy of the source data and review the proposed changes before any write to target systems.
- Downstream dependencies: Confirm with mail, VPN and application owners which identifiers they rely on.
Record the decision on existing usernames in writing, since it determines how the template is tested.
In a setup with development, test and production, object templates are configuration objects that must be promoted without carrying environment-specific values into the wrong stage. The main risk is that a template tested against synthetic data behaves differently against production sources, or that a hard-coded domain or system reference is promoted by mistake. Teams should separate environment values from logic before the first promotion.
- Environment-specific values: Identify domains, target system names and connector references that must differ per stage and keep them out of the template body.
- Versioned configuration: Store template objects in version control so each promotion is traceable to a reviewed change.
- Staged test data: Use a non-production copy of authoritative data that resembles production in name patterns and duplicates.
- Promotion checklist: Define checks for uniqueness results, role assignments and mapping outputs before production import.
- Rollback path: Agree how a faulty template is reverted and how already-computed values are handled.
Confirm with your platform team how configuration is deployed to each environment, because the promotion method decides how environment values are kept apart.
How DeployOpen works on this
DeployOpen plans, implements and supports midPoint inside your own infrastructure, including the object templates that compute derived attributes, generate unique usernames and assign roles automatically. Work starts from a written scope, is built and tested in your environment, and is handed over with documentation your team can maintain.
How we scope
- Inventory the identity attributes, source systems and naming rules that object templates must derive or enforce.
- Agree in writing which mappings, uniqueness rules and automatic role assignments are in scope.
- Define the test users, edge cases and environments needed to prove templates behave as specified.
How we build
- Configure object templates and mappings in a non-production environment before any change reaches production.
- Set iteration rules for unique usernames and confirm how collisions are handled for existing accounts.
- Test template results against sample records, including renames, moves and returning users.
How we hand over
- Document each template, mapping, expression and role assignment rule with its inputs and expected outputs.
- Walk your identity and platform teams through change steps, rollback and how to test a new template version.
- Deliver configuration in a form your team can review and keep under version control.
How we support
- Engagements are fixed-scope, so changes after handover are scoped and quoted separately in writing.
- Ongoing support, upgrades and continuous testing for template changes are available as a retainer.
- Confirm with your team how template changes will be reviewed before each midPoint upgrade.

