feat(identity-providers): add mapper order functionality #45849
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closed #45848
we setup identity providers saml, we added many mappers,
but we want to control the order of the mapper, to set which mapper will be executed and which one after
so for each mapper we will have a new field order where we will enter a number 1,2,3,4....
we will wrapper with a new toggle flag
if toggle flag is off, then order of mappers is executed the same as today
if toggle flag is on, then order of mappers is executed by the numbers we setted
What I changed (backend + Admin UI)
New IdP toggle: config.mapperOrderEnabled (boolean string "true"/"false") on the Identity Provider.
OFF (default): mapper execution order is unchanged (legacy order).
ON: mappers execute in ascending numeric order using each mapper’s config.mapperOrder.
New per-mapper field: config.mapperOrder (number-as-string, e.g. "1", "2", ...).
Missing/invalid/negative values are treated as “no order” and run after ordered mappers.
Where execution order is applied
Mapper execution is now ordered (when enabled) for:
Broker login flow (preprocess/import/update) in IdentityBrokerService
SAML SP metadata export mappers in SAMLIdentityProvider
Token-exchange broker flows in AbstractTokenExchangeProvider
Central logic lives in server-spi-private/.../IdentityProviderMapperExecutionOrder.java.
Admin ### UI changes
In the IdP Mappers tab:
Added “Mapper order enabled” toggle (saves immediately)
Added a Mapper order column and sorts the list by it when enabled
In the Add/Edit Mapper form:
Added Mapper order numeric field (config.mapperOrder)