Engineering guide · ICAM
Identity Provider Routing
On this page
Rule ModelAPICreate A Safe DefaultResolve A Sign-InPersistence And EvidenceFailure BehaviorVerifyAtlas evaluates tenant-scoped identity-provider routing rules in ascending priority order. The first enabled rule whose conditions match selects an enabled OIDC, SAML, or inbound WS-Federation provider, local authentication, or a deny result. This is compatible with the first-match discovery model described in the Okta identity-provider routing overview, while Atlas adds optimistic versions, hash-only idempotency, provider-readiness checks, one-time source-bound decisions, and state-bound evidence.
Routing improves sign-in selection. It is not an authentication or assurance control. The selected provider must still pass issuer, audience, signature, nonce or request-correlation, replay, time, certificate, account-linking, and assurance checks. Application and session policy may require a stronger factor after routing.
Rule Model
Lower priority numbers run first. Values within one condition list use OR semantics; non-empty condition lists use AND semantics.
| Condition | Behavior |
|---|---|
|
Matches only the canonical domain extracted from a login hint. Atlas neither persists nor returns the raw login hint. |
|
Matches the server-derived client address against one or more canonical CIDRs. Prefer a named zone when the boundary is shared. |
|
Matches one or more active, tenant-scoped |
|
Rejects the rule when the server-derived address falls within an excluded range. |
|
Matches an opaque Atlas application identifier. |
The public resolver does not accept a caller-supplied source address.
Forwarding headers are considered only when the immediate peer matches an active trusted_proxy Network Zone.
Atlas walks the chain right to left through explicitly trusted tiers and stops at the first untrusted hop.
See Network Zones And Trusted Proxies.
Every enabled policy has exactly one catch-all rule with empty conditions, and that rule has the lowest precedence. Enabled rules cannot share a priority or an identical condition set. The database rechecks these invariants at transaction commit while mutations hold a tenant-scoped transaction lock.
Provider actions may be enabled only when the provider is enabled in the managed registry and loaded in the live OIDC, SAML, or inbound WS-Federation runtime. A provider that becomes unavailable makes evaluation fail closed. Rules cannot be deleted; disable a rule to preserve its history.
Atlas does not accept pre-authentication profile attributes, device posture, platform claims, or arbitrary expressions from this public request. A login hint is not proof of the named identity, and a browser user-agent or caller-supplied device value is not trustworthy posture evidence. Verified device, risk, identity-attribute, and phishing-resistance requirements belong to authentication and application policy after proof of identity; they can strengthen or deny the routed sign-in but routing cannot weaken them.
API
| Method | Route | Purpose | Authorization |
|---|---|---|---|
|
|
Resolve the public sign-in path |
Public, bounded input |
|
|
List or create rules |
|
|
|
Read or version a rule |
Matching routing capability; fresh AAL2 |
|
|
Verify and return append-only evidence |
|
|
|
Preview the real evaluator with an ordered trace |
|
The OpenAPI contract and Swagger UI are available from the gateway /openapi.json and /docs/ surfaces.
The protected preview API accepts sourceIp for deterministic administration tests.
The public resolver always replaces that value with the address derived by the server.
The routing service independently limits read and preview authentication age to 15 minutes and mutation authentication age to 10 minutes, even if a deployment’s outer authorization baseline is temporarily weaker.
Create A Safe Default
Create the catch-all before enabling narrower rules:
curl -sS -X POST "$ATLAS_URL/api/v1/federation/routing-rules" \
-H "Authorization: Bearer $ATLAS_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: routing-default-local-20260724" \
--data '{
"id": "default-local",
"name": "Default local authentication",
"priority": 10000,
"enabled": true,
"conditions": {},
"action": {"type": "local"},
"expectedVersion": 0,
"reason": "establish explicit fail-safe default"
}'
Then add a narrower provider rule:
{
"id": "mission-managed-network",
"name": "Mission workforce",
"priority": 100,
"enabled": true,
"conditions": {
"loginHintDomains": ["mission.example.mil"],
"networkZoneIds": ["mission-network"],
"excludedNetworkCidrs": ["10.40.66.0/24"],
"applicationIds": ["mission-planning"]
},
"action": {
"type": "provider",
"providerId": "mission-oidc"
},
"expectedVersion": 0,
"reason": "route managed mission users"
}
Create and update requests require an Idempotency-Key of 16 to 200 characters.
Atlas stores only its tenant-bound digest.
An exact replay by the same actor returns the original response; reuse by another actor or with changed input returns 409.
Updates require the current expectedVersion.
Resolve A Sign-In
curl -sS -X POST "$ATLAS_URL/api/v1/authn/federated/route" \
-H "Content-Type: application/json" \
--data '{
"loginHint": "operator@mission.example.mil",
"applicationId": "mission-planning"
}'
A provider decision returns a login path containing a cryptographically random route token. Only a domain-separated digest of that bearer token is used as a cache key. The encrypted cache record expires after three minutes and binds the provider, rule identifier and version, decision digest, and a tenant-domain-separated hash of the source address. The protocol login atomically consumes the token once. A replay, source change, rule version change, rule disablement, provider disablement, provider-runtime failure, or changed source-to-zone decision is denied. Direct OIDC, SAML, and inbound WS-Federation login routes enforce the same token whenever routing policy is configured.
The public response omits the matched rule, trace, raw login hint, and source address. It exposes only the action, selected provider when applicable, safe reason code, login path, and input and decision digests. Public resolution and route-token consumption use separate source and tenant-domain-separated input-digest rate-limit buckets; raw login hints and route tokens are never retained as limiter keys.
Persistence And Evidence
PostgreSQL owns rules, mutation replay bindings, and evidence.
federation_routing_rules is tenant-keyed and versioned.
federation_routing_replays stores only the replay-key digest, request digest, actor binding, and original response.
federation_routing_events is append-only; each event binds the complete committed rule state, its previous event, actor, version, timestamp, and a digest of the operator reason.
Database triggers reject deletion, identity changes, skipped versions, event or replay mutation, a rule version without matching evidence, an ambiguous catch-all, a misordered catch-all, and duplicate enabled condition sets.
When the gateway has no PostgreSQL-backed configuration store outside a development-like environment, every federation start path fails closed with routing unavailable. Provider selection also requires the encrypted Redis decision cache. The current public federation runtime resolves the platform’s configured default ICAM tenant; provider actions for another tenant remain unavailable until that tenant has an independently bound provider runtime.
Failure Behavior
400 indicates invalid input or a body that is not one JSON object.
403 indicates missing operator scope, routing capability, fresh AAL2, or a failed route-token binding.
404 indicates a tenant-local rule is absent.
409 indicates an idempotency, priority, policy, or optimistic-version conflict.
413 indicates a request body over 64 KiB.
429 indicates a source or privacy-preserving input-digest rate limit.
415 indicates a missing or non-JSON content type.
503 indicates the policy store, authorization dependency, encrypted decision cache, or selected provider is unavailable.
Verify
Internal implementation checks are omitted from this public guide.
The integration test applies the real identity migrations, persists ordered rules, proves exact replay and restart-stable evaluation, verifies that raw runtime input and replay keys are absent from durable rule state, and proves PostgreSQL rejects evidence mutation.
Run it through make icam-workflow-docker-test when the validation host has sufficient memory.