Why midPoint mappings and expressions need design before the first script
Most teams configuring midPoint reach for a script too early. A team that must derive attributes, transform values and sync data from an HR source and several target systems needs to decide first whether a midPoint mapping is enough, or whether an expression is required. A mapping is the declarative link between a source value and a target property on an object. An expression is the logic that computes the value when the link alone cannot. Making that split well is what keeps the configuration readable when the next administrator inherits it.
In the object model, inbound mappings run when data arrives from a resource, through synchronization, and feed values into the identity object in the repository. Outbound mappings run when midPoint calculates what a target system should receive, typically when provisioning or reconciling an account. The same attribute can be shaped at both points, so a change in one direction can silently alter the other. Before writing anything, map each attribute to its direction, its owner (HR, the target system, or midPoint itself) and the object type it lands on. Confirm which of those rules you intend to be authoritative for each attribute, because that choice drives conflict behavior later.
This page covers the decisions that follow from that map: choosing expression types, setting mapping strength and range so that sources do not overwrite each other unexpectedly, and structuring scripts so they can be read and tested. midPoint 4.11 adds mapping authoritativeness indicators based on strength and range, and GUI support for ranges in mappings, according to the midPoint 4.11 release notes. Check which release your environment runs before you rely on those controls, because older versions may not expose them in the same way.
Which expression type and mapping setting fits each case
This table compares the main choices a designer makes when a value moves between midPoint and a target or source system, from a direct mapping to scripts and library calls, plus strength and range settings. Read each row as a question to ask about a specific attribute, then check the maintainability and testing notes before adding logic. The main takeaway is that the simplest option that expresses the rule is usually the one your team can still explain after the next release.
| Choice | Best fit | Maintenance and hidden logic risk | What to confirm |
|---|---|---|---|
| Direct source-to-target mapping | Value copies with no transformation, such as a mail attribute from HR to a directory | Low. Easy to review in the object view, but reviewers miss the mapping if it sits in a template far from the resource | Which attributes the connector returns and whether the target expects the same format |
| Path-based expression | Reading a value from another object in the model, such as a manager's identifier | Low to moderate. Paths break silently when the schema changes, so check them after each upgrade | Path syntax and the objects reachable from your mapping context in your release |
| Script expression (inline) | Short conditional logic, string composition or a single lookup that no other mapping needs | Moderate. Logic hidden in one object is hard to find and easy to copy with errors into other resources | Which script languages and expression types your release supports, and the security rules that apply to them |
| Library or function-based expression | Logic repeated across several mappings, such as username or email generation rules | Lower risk of drift if one shared definition is used, but changes affect every caller, so version and test them | How your team versions library code with configuration and where tests run |
| Weak mapping strength | Default value that a user or another source may override, such as an initial department | Low. The risk is a value that never updates when the source changes, which looks like a defect | How weak and normal mappings interact in your release for the attribute in question |
| Normal or strong mapping strength | Values midPoint must keep aligned with the source, or must push to a target on every change | Strong mappings overwrite manual edits, so a wrong expression spreads to all affected accounts quickly | Whether a strong mapping on the target side needs a safety review before rollout |
| Range settings | Limiting a mapping to a time window or set of values, such as temporary access dates | Moderate. Range logic that is not tested can leave access in place or remove it early | Range behaviour and the GUI support in your release, including the version that added range indicators |
| Authoritativeness indicators (4.11 and later) | Showing which source is authoritative for an attribute when several sources feed one value | Low once documented. Without a written owner per attribute, the indicator alone does not settle conflicts | Whether your planned release is 4.11 or later before relying on this feature |
How to build and test a mapping in a midPoint environment
This sequence takes a mapping from an attribute decision on paper to a verified, promoted configuration in production. Each step closes with a check, so the team can show that the mapping does what the source of truth says before it touches live identities.
Document the source of truth per attribute
Before writing any mapping, list each target attribute (for example, email, department, or manager) and name the system that owns it, the mapping direction, and the conditions under which midPoint may overwrite it. Identity owners, HR, and the application owner of each target should sign off on this table. Done means every attribute in scope has one named authoritative source and one written rule for conflicts. The check is simple: if two attributes in the table claim the same authority, the design is not finished.
Define mappings in a non-production environment
The engineer builds inbound and outbound mappings in a non-production midPoint instance that mirrors the production connector configuration as closely as the team can manage. Choose the expression type for each mapping, set strength and range where the target system needs them, and keep each mapping small enough to explain in one sentence. Midpoint 4.11 adds mapping authoritativeness indicators based on strength and range, and GUI support for ranges, so confirm which release the environment runs before relying on those controls. The check is that every mapping in the table exists in the non-production object set and nothing is defined in the production instance first.
Test with sample data and preview runs
Load a small set of representative accounts, including edge cases such as duplicate names, missing fields, leavers with open access, and accounts with manual overrides. Run simulations or preview changes where midPoint offers them, and compare the proposed projections with the expected values from step one. Record each case with its input, expected output, and actual output. The check is a written test set where every expected output matches the preview, and every mismatch has either a fix or a documented decision.
Review expression logic for maintainability
A second engineer reads each expression and asks three questions: can someone outside the author explain the result, does the logic repeat anything already in a function library or object template, and will a schema change break it silently. Move repeated logic into shared components where the team's design supports it, and replace clever one-liners with named steps and comments that state the business rule. Confirm the security posture of the expression type the team chose, since scripting choices carry different risks. The check is a review record where the reviewer can restate each rule without asking the author.
Promote configuration through the change process
Export the reviewed mapping objects and move them through the team's standard change path, such as a branch, a pull request, and an approval in the change system. Use the same object definitions in test and production so that the promoted content matches what was reviewed. Record the version or commit that reaches each environment. The check is that the production object set matches the reviewed export, confirmed by comparing identifiers or a diff of the exported XML or configuration files.
Verify results with reconciliation
After promotion, run reconciliation on the affected resources and compare the repository state with the target systems for a defined sample and then the full population. Look for accounts that changed unexpectedly, attributes that drift back after each run, and objects that fall into correlation exceptions. Keep the reconciliation report with the change record. The check is a reconciliation run where the count of unexpected changes is zero or each change is explained and accepted by the data owner. Repeat the check after the first scheduled run, because a mapping that behaves correctly once may still conflict with another source on the next cycle.
How a value travels through an inbound and outbound mapping
The walk starts at a source resource whose attribute is read by an inbound mapping into the midPoint user. Object template processing then computes derived values and applies assignments before the change is recorded in the repository. An outbound mapping reads the resulting user attribute and pushes it to the target resource through its connector. The checkpoint sits between configuration and production: run a preview or simulation with representative accounts and confirm each hand-off produces the value you expect.
Value flow from a source attribute to a target resource, with the preview checkpoint before production.
Keeping expressions readable, reviewable and testable
The most durable midPoint mappings are small, named clearly and written so that a reviewer can tell what each one does without running it. Keep each mapping to one job: derive one attribute, or transform one value, rather than setting several targets from one long script. Give every mapping a name that states its purpose, such as deriving a primary email address from HR data, and record in the mapping's documentation which source attributes it expects and what it does when they are missing or malformed. Assumptions about source data are the most common cause of silent errors after a source system changes its format, so write them down next to the expression, not in a separate wiki page that nobody reads. Where a sibling mapping or object template already computes the same value, reference that logic instead of copying it, because a copied expression will drift from the original the first time one of them is edited.
Decide early where logic belongs. Logic that applies to every object of one type, such as deriving a username or assigning default roles from attributes, usually fits an object template, where it runs once per object and is easy to find. Logic that repeats across several templates or resources is a candidate for a function library, which keeps one definition under version control. Logic that only one mapping needs should stay in that mapping. Keep the configuration in files so changes go through the same review as application code: midPoint Studio and the XML or JSON object files can be stored in Git, and each change can then be reviewed as a diff. Confirm with your Evolveum release notes and your own environment which object formats and export options your version supports. The midPoint 4.11 release notes describe mapping strength and range indicators, which make the intent of each mapping easier to review when your team adopts them. Language choice, Groovy or the newer midPoint Expression Language, is covered on the sibling pages, so settle that question before you standardize naming and file layout.
Security risks in expressions that teams should control
Mappings and expressions run with midPoint's privileges and touch the identity data that drives every access decision. The cards below name the risks that recur in these scripts and the control a team should put in place for each. Expression hardening in general is covered on the midPoint security hardening practices page.
Scripts that expose secrets
Expressions often need credentials for lookups, API calls or connector settings, and a script with a hardcoded password or token leaks that value to anyone who can read the configuration object. Keep secrets in the protected credential storage that midPoint provides and reference them from expressions, never inline them. Check exported XML and Studio project files for literal values before they reach version control.
Expressions with excess privilege
An expression runs with the authority of the context that executes it, so a mapping that only needs to read one attribute can end up changing objects it should never touch. Review which actions each expression performs and confirm that the execution context matches that need. Ask your midPoint administrators which expression types are permitted in your environment before granting script authoring rights.
Unreviewed script changes in production
A one-line change to a mapping can alter provisioning for thousands of accounts on the next reconciliation run. Require every expression change to pass through a versioned repository, peer review and a test environment before import into production. Record who approved each change so auditors can trace why an access outcome changed.
Data leakage through logs
Debug logging inside a script can write personal data, attribute values or account details into log files that are retained longer than the identity data itself. Log object identifiers and outcomes rather than full attribute values, and confirm which logger levels are enabled in production. Review log access rights and retention with your security team, since log stores are often less restricted than the identity repository.
Unbounded logic that changes many accounts
A mapping that unintentionally derives an empty or wrong value can propagate that value to every linked target system. Add explicit guards for null and unexpected input, and use safety thresholds on synchronization so a faulty expression stops before mass changes. Test expressions against a representative sample of accounts, including edge cases such as duplicate names and missing attributes.
Questions teams ask before writing midPoint mappings
Can our own team write midPoint mappings without a partner?
Yes, a team with identity engineering skills and time to learn midPoint's expression model can write its own mappings, and many do. The harder part is not the syntax but deciding which system is authoritative for each attribute, testing edge cases against real account data, and keeping the logic reviewable as sources change. Ask yourself whether two or three engineers can own the mappings after go-live, including reviewing changes and running regression tests. If not, a partner can build the first version and hand over documentation, test cases and a review process. The Evolveum documentation covers the mapping model in depth, and the midPoint releases page lists the version your team would be building against.
What makes midPoint mapping work take longer or cost more?
Effort follows the number of inputs and the conflicts between them. The main drivers are the number of source systems feeding each identity attribute, how often two sources claim the same attribute, how clean the source data is, how much custom logic the business requires, and how much testing the rules need. Each additional source multiplies the cases to test. Poor data quality, such as duplicate employee records or inconsistent name formats, usually adds discovery and cleanup work before any mapping is written. Custom logic, for example derived usernames or conditional role assignment, adds design and test effort. Ask any provider to break its quote into discovery, design, build, test and handover so you can see which driver is largest.
What do we need to provide for a mapping project?
The project needs four things from your side: named owners for each source system who can explain what the data means and when it changes, test environments that hold realistic copies of source data or equivalent samples, a documented decision on which system is authoritative for each attribute, and a person who can approve the business rules. Without the authority decision, mappings will conflict and the team will spend time on arguments rather than configuration. Access to connector credentials in non-production environments and time from the people who review outputs are also needed. Ask the provider to list these inputs in the written scope so you can confirm owner availability before work starts.
How do we decide which system is authoritative for an attribute?
Decide authority per attribute, not per system. For each identity attribute, such as employment status, department or email address, record which source is the system of record, which systems may only read or suggest changes, and what happens when sources disagree. Midpoint 4.11 adds mapping authoritativeness indicators based on mapping strength and range, which makes these choices visible in the GUI, according to the midPoint 4.11 release notes. Confirm which release your environment will run before you rely on those indicators, since older versions handle strength and range differently. Write the decision table before building mappings, and have the business owners of each attribute sign it.
How long does a mapping project take?
Duration depends on scope, and no fixed figure applies to every project. A single source feeding a few attributes with no conflicts is a short exercise. A project with several authoritative sources, derived attributes, multiple target systems and formal test cycles takes considerably longer, mostly because of data discovery and approval cycles rather than the expression writing itself. Ask for a timeline tied to named milestones: source analysis, authority decisions, mapping build, test cycles and handover. Then ask which milestones depend on your people, such as owner sign-off or environment access, because those are the ones that most often slip.
Does a fixed-scope engagement suit mapping work?
It can, when the scope is clear. A fixed-scope engagement works well for a defined set of sources, attributes and target systems, with deliverables and acceptance tests agreed in writing before work starts. It is less suitable when authority decisions are still open, because changes to those decisions change the work. DeployOpen plans most engagements as fixed-scope, with scope, deliverables and timelines agreed in writing before work begins. Ask for the assumptions behind the scope, especially source data quality and owner availability, and what happens if an assumption fails.
How do we request a quote from a written scope?
Start with a written scope document that lists the source systems, target systems, attributes in scope, the authority decision for each, the custom logic you expect, the test environments available and the people who will sign off. Add the release of midPoint you plan to run and the environment it will be hosted in. DeployOpen does not publish a price list. A quote follows from the written scope, so the more precise the document, the more precise the quote. Ask every provider to state which items are included, which are excluded and which of your inputs the price assumes.
How DeployOpen scopes and delivers midPoint mapping work
Mapping work touches HR sources, target systems and access decisions, so the scope needs to be fixed before the first expression is written. The cards below cover how DeployOpen agrees that scope in writing, where the work runs, what gets documented and tested, and how changes are handled after go-live.
Written scope before any mapping
Most engagements are fixed-scope, so the mapping inventory, deliverables and timelines are agreed in writing before work starts. For mappings, that means listing each inbound source attribute, each outbound target attribute, the systems involved and the authoritative source for each value. Ask the partner to show which mappings are in scope and which are excluded, such as legacy scripts or custom schema extensions handled separately. The written scope is the document that decides what counts as finished.
Work inside your infrastructure
Mappings are built and tested in environments you control, including your cloud accounts, data centers or air-gapped networks. Confirm which midPoint environments the team will access, such as development and staging, and how configuration moves into production. Ask who holds administrator credentials for the midPoint repository and connected systems, and when those credentials are rotated or revoked at project end.
Documented mapping design
Each mapping should have a written record of its source, target, strength, range, expression type and the reason for the choice. Documentation lets your identity team review logic without reading every script. Ask for a mapping register that maps each attribute to its owner and to the test that covers it. Without this record, later administrators cannot tell whether a value comes from HR or from a manual edit.
Tests for each mapping path
Testing covers the expected inputs, edge cases such as missing or duplicated HR values, and the outbound effect on each target system. Plan test data that reflects your real joiner, mover and leaver cases, and run the tests against staging connectors before any production sync. Ask the partner how test results are recorded and what happens when a mapping fails a test.
Version control and change handling
Configuration files and expressions should live in version control so each change has an author, a review and a rollback point. Agree who approves changes to authoritative mappings, since a small edit can alter access for many users. Ask how the partner handles urgent fixes and whether changes go through the same review as planned work.
Retainers for changes and upgrades
After delivery, mapping changes often follow new HR fields, new target systems or midPoint release upgrades. DeployOpen offers retainers for ongoing changes, upgrades and continuous testing. Before signing, confirm which release line you run, which releases the retainer covers and how a mapping that behaves differently after an upgrade is re-tested. Evolveum's release page lists support dates for each midPoint line, which helps set the upgrade cadence.
midPoint releases
