Engineering guide · ICAM

Custom Authorization Servers

Status: control plane, rollover, rollback, and PKCS#11 interface Docker validated; nested JWE implemented and unit-tested with Docker validation pendingReviewed: 2026-08-15Audience: API developers, identity architects, security engineers, platform operators
On this pageClient Token EncryptionResource ModelAuthentication And CapabilitiesMutation ContractServer LifecycleScopesClaimsPolicies And RulesPer-Server Signing KeysStorage And EvidenceErrors And Fail-Closed BehaviorOpenAPI And CompatibilityVerificationUpstream References

Atlas custom authorization servers provide an Okta-friendly API for independent OAuth issuers, scopes, claims, access policies, policy rules, and signing keys. The API shape follows the current Okta management surface while Atlas adds inactive-only configuration, compare-and-swap mutation, actor-bound idempotency, independent activation and key approval, live directory reevaluation, per-server P-384 keys, and state-bound evidence.

The public protocol surface is documented at OIDC Authorization Server. OAuth grants, refresh families, RFC 8693, and ID-JAG are documented at OAuth Grants, Refresh Tokens, And Token Exchange.

Client Token Encryption

An active custom authorization server can require signed-then-encrypted tokens for one client and token class:

GET /api/v1/authorizationServers/{authorizationServerId}/clients/{clientId}/token-encryption
PUT /api/v1/authorizationServers/{authorizationServerId}/clients/{clientId}/token-encryption
POST /api/v1/authorizationServers/{authorizationServerId}/clients/{clientId}/token-encryption/{tokenType}/approve

tokenType is ID_TOKEN or ACCESS_TOKEN. The only accepted algorithms are ECDH-ES and A256GCM. The recipient JWK must be a public EC P-384 encryption key with no private d member, no unknown fields, and a kid equal to its RFC 7638 thumbprint. Symmetric keys and private JWKs are rejected.

Store each reviewed public JWK in the configured Vault path under public_jwk_generation_N, then stage its reference:

{
  "tokenType": "ACCESS_TOKEN",
  "alg": "ECDH-ES",
  "enc": "A256GCM",
  "recipientKeyRef": "vault://oidc/tenants/TENANT_ID/recipient-encryption/mission-client",
  "recipientKid": "RFC7638_PUBLIC_JWK_THUMBPRINT",
  "recipientKeyGeneration": 7,
  "expectedVersion": 12
}

The reference is accepted in the write request but is never returned by the public API. The canonical Vault namespace contains the exact Atlas tenant; cross-tenant, opaque, encoded, traversal, query-bearing, and ambiguous paths are rejected by both the service and PostgreSQL state constraint. A different fresh phishing-resistant AAL3 actor approves the transition. Approval re-resolves the exact public key generation.

Atlas signs the JWT first with the authorization server’s ES384 key and then emits compact JWE. The protected JWE header contains typ: JWT, cty: JWT, kid, atlas_key_generation, and atlas_token_type. Nested encryption is applied to authorization-code ID and access tokens, refresh access tokens, client-credentials access tokens, and RFC 8693 or ID-JAG exchange results.

Issuance verifies the sealed aggregate before encryption, resolves the exact recipient generation, and repeats both checks after encryption. A concurrent configuration or key change fails the issuance. Missing, inconsistent, or retired settings also fail closed; Atlas never downgrades that client to a signed plaintext token.

Recipient-encrypted access tokens have an explicit resource-server boundary. Atlas returns an outer compact ECDH-ES/A256GCM JWE whose plaintext is the signed ES384 at+jwt. Only the configured recipient owns the decryption key. Consequently, the Atlas UserInfo endpoint cannot and does not decrypt the outer envelope. A client that needs UserInfo after opting into access-token encryption decrypts the envelope locally and presents the inner compact at+jwt as the bearer token. Presenting the outer JWE fails with invalid_token. This preserves private-key separation instead of copying a recipient private key into the authorization server.

This control plane intentionally applies only to custom authorization servers. The fixed default issuer has no mutable per-client authorization-server aggregate, so Atlas does not claim or silently invent default-server JWE configuration. Use a custom authorization server whenever client-specific token encryption is required.

Unit coverage decrypts the outer JWE and verifies the inner ES384 JWT for all five issuance paths:

Internal implementation checks are omitted from this public guide.

Resource Model

Each custom server owns:

  • one exact issuer, https://ATLAS_ORIGIN/oauth2/AUTHORIZATION_SERVER_ID;

  • exactly one configured base audience;

  • an independent ES384/P-384 signing-key ring;

  • up to 256 scopes and 256 safe claims;

  • up to 128 first-match authorization policies;

  • up to 1,024 first-match policy rules;

  • a bounded maker-checker transition set;

  • a sealed idempotency receipt map and an append-only evidence chain.

Server identifiers are globally unique UUIDs. Every management read is tenant-scoped. The issuer and tenant cannot be reassigned. Physical server deletion is prohibited; the delete route writes a tombstone.

The top-level response fields retain familiar Okta names:

{
  "id": "eb1b9c11-70df-4418-885f-c232c649b149",
  "name": "mission-api",
  "description": "Mission application authorization boundary",
  "audiences": ["https://mission-api.example.mil"],
  "issuer": "https://id.atlas.example/oauth2/eb1b9c11-70df-4418-885f-c232c649b149",
  "issuerMode": "ATLAS_FIXED",
  "status": "INACTIVE",
  "credentials": {
    "signing": {
      "rotationMode": "MANUAL",
      "use": "sig"
    }
  },
  "_atlas": {
    "version": 1,
    "etag": "W/\"atlas-authz-server-1\"",
    "evidenceHead": "…",
    "assurance": "AAL3_INDEPENDENT_ACTIVATION",
    "runtimeReady": false,
    "unmetRequirements": [
      "active signing key",
      "active policy and rule"
    ]
  }
}

Atlas extensions remain under _atlas, so clients that ignore unknown properties can continue using the compatibility fields.

Authentication And Capabilities

All management routes require an authenticated Atlas bearer session. The service repeats tenant, actor, assurance, freshness, and factor checks behind the gateway.

Capability Minimum assurance Freshness Use

authorization-servers.read

AAL2

15 minutes

List and inspect servers, configuration, public keys, and evidence.

authorization-servers.manage

AAL2

10 minutes

Mutate inactive scopes, claims, policies, and rules; tombstone a server.

authorization-servers.manage

Phishing-resistant AAL3

5 minutes

Create or replace a server and deactivate an active server.

authorization-servers.activate

Phishing-resistant AAL3

5 minutes

Stage and independently approve activation.

authorization-servers.keys.rotate

Phishing-resistant AAL3

5 minutes

Stage and independently approve key rotation or bounded rollback.

The activation, key-rotation, and key-rollback approver must differ from the actor that staged the transition. A request claim cannot weaken these checks.

Mutation Contract

Every mutation requires:

  • Idempotency-Key: 16 through 200 characters;

  • X-Atlas-Reason: a non-empty, single-line purpose;

  • If-Match: the current _atlas.etag, except on server creation.

The raw idempotency key and raw reason are not stored. Atlas stores a tenant-domain-separated idempotency lookup and a protected reason reference. An exact replay by the same actor returns the original response. Reusing the key for a changed operation, request, or actor returns 409 Conflict.

Every mutation after creation uses aggregate compare-and-swap. A stale ETag returns 409 and does not append evidence. Configuration is immutable while a server is active or has a pending transition. Deactivate, edit, and independently reactivate instead.

Server Lifecycle

Create an inactive server:

curl --fail-with-body \
  -H "Authorization: Bearer ${AAL3_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: authz-server-create-20260726-001" \
  -H "X-Atlas-Reason: establish the mission API authorization boundary" \
  -X POST https://id.atlas.example/api/v1/authorizationServers \
  -d '{
    "name": "mission-api",
    "description": "Mission application authorization boundary",
    "audiences": ["https://mission-api.example.mil"],
    "issuerMode": "ATLAS_FIXED",
    "rotationMode": "MANUAL"
  }'

List or read:

GET /api/v1/authorizationServers?q=mission&limit=50
GET /api/v1/authorizationServers/{authorizationServerId}

Replace only while inactive:

curl --fail-with-body \
  -H "Authorization: Bearer ${AAL3_TOKEN}" \
  -H "Content-Type: application/json" \
  -H 'If-Match: W/"atlas-authz-server-1"' \
  -H "Idempotency-Key: authz-server-replace-20260726-001" \
  -H "X-Atlas-Reason: bind the approved resource audience" \
  -X PUT "https://id.atlas.example/api/v1/authorizationServers/${SERVER_ID}" \
  -d '{
    "name": "mission-api",
    "audiences": ["https://mission-api.example.mil"],
    "issuerMode": "ATLAS_FIXED",
    "rotationMode": "MANUAL"
  }'

Activation is intentionally two-stage:

# Maker
curl --fail-with-body \
  -H "Authorization: Bearer ${MAKER_AAL3_TOKEN}" \
  -H 'If-Match: W/"atlas-authz-server-9"' \
  -H "Idempotency-Key: authz-activation-stage-20260726-001" \
  -H "X-Atlas-Reason: configuration passed application review" \
  -X POST \
  "https://id.atlas.example/api/v1/authorizationServers/${SERVER_ID}/lifecycle/activate"

# A different approver, using the returned transition ID and ETag
curl --fail-with-body \
  -H "Authorization: Bearer ${APPROVER_AAL3_TOKEN}" \
  -H 'If-Match: W/"atlas-authz-server-10"' \
  -H "Idempotency-Key: authz-activation-approve-20260726-001" \
  -H "X-Atlas-Reason: independent production activation approval" \
  -X POST \
  "https://id.atlas.example/api/v1/authorizationServers/${SERVER_ID}/_atlas/transitions/${TRANSITION_ID}/approve"

Activation fails unless the server has an active signing key and at least one active policy with an active rule. The approval rechecks readiness against the exact staged aggregate.

Deactivation is immediate but requires fresh phishing-resistant AAL3:

POST /api/v1/authorizationServers/{authorizationServerId}/lifecycle/deactivate

Scopes

Scope routes follow the Okta path shape:

GET|POST /api/v1/authorizationServers/{authorizationServerId}/scopes
GET|PUT|DELETE /api/v1/authorizationServers/{authorizationServerId}/scopes/{scopeId}

Create a published scope:

{
  "name": "mission.read",
  "description": "Read approved mission resources",
  "displayName": "Read mission resources",
  "consent": "REQUIRED",
  "default": false,
  "optional": true,
  "metadataPublish": "ALL_CLIENTS"
}

Names are bounded and unique per server. consent accepts FLEXIBLE, IMPLICIT, or REQUIRED. metadataPublish accepts ALL_CLIENTS or NO_CLIENTS. Deleting a scope referenced by a claim or rule fails with 409.

Claims

Claim routes are:

GET|POST /api/v1/authorizationServers/{authorizationServerId}/claims
GET|PUT|DELETE /api/v1/authorizationServers/{authorizationServerId}/claims/{claimId}

Atlas does not execute arbitrary expression language in token signing. An EXPRESSION claim must select one allowlisted value:

  • user.id;

  • client.id;

  • tenant.id;

  • assurance.aal;

  • assurance.ial.

Example:

{
  "name": "atlas_assurance_level",
  "status": "ACTIVE",
  "claimType": "RESOURCE",
  "valueType": "EXPRESSION",
  "value": "assurance.aal",
  "alwaysIncludeInToken": false,
  "conditions": {
    "scopes": ["mission.read"]
  }
}

A GROUPS claim accepts only a bounded CONTAINS, EQUALS, STARTS_WITH, or Go-compatible REGEX filter. Group values come from the live tenant Universal Directory resolver, not from caller-supplied request claims. Reserved JWT and Atlas binding claims cannot be replaced.

Policies And Rules

Policy routes are:

GET|POST /api/v1/authorizationServers/{authorizationServerId}/policies
GET|PUT|DELETE /api/v1/authorizationServers/{authorizationServerId}/policies/{policyId}
POST /api/v1/authorizationServers/{authorizationServerId}/policies/{policyId}/lifecycle/activate
POST /api/v1/authorizationServers/{authorizationServerId}/policies/{policyId}/lifecycle/deactivate

Rules are nested:

GET|POST /api/v1/authorizationServers/{authorizationServerId}/policies/{policyId}/rules
GET|PUT|DELETE /api/v1/authorizationServers/{authorizationServerId}/policies/{policyId}/rules/{ruleId}
POST /api/v1/authorizationServers/{authorizationServerId}/policies/{policyId}/rules/{ruleId}/lifecycle/activate
POST /api/v1/authorizationServers/{authorizationServerId}/policies/{policyId}/rules/{ruleId}/lifecycle/deactivate

Example policy:

{
  "type": "OAUTH_AUTHORIZATION_POLICY",
  "name": "Mission applications",
  "priority": 10,
  "status": "ACTIVE",
  "conditions": {
    "clients": {
      "include": ["mission-web", "mission-service"]
    }
  }
}

Example rule:

{
  "type": "RESOURCE_ACCESS",
  "name": "Approved mission operators",
  "priority": 10,
  "status": "ACTIVE",
  "conditions": {
    "grantTypes": {
      "include": ["authorization_code", "refresh_token"]
    },
    "scopes": {
      "include": ["mission.read"]
    },
    "people": {
      "users": {
        "include": ["*"]
      },
      "groups": {
        "include": ["mission-operators"]
      }
    }
  },
  "actions": {
    "token": {
      "accessTokenLifetimeMinutes": 10,
      "refreshTokenLifetimeMinutes": 480,
      "refreshTokenWindowMinutes": 60
    }
  }
}

Policy and rule evaluation is ordered by ascending priority and stable identifier. The first active matching policy and first active matching rule decide the request. No match denies issuance. Supported grant conditions are authorization code, client credentials, refresh token, RFC 8693 token exchange, ID-JAG JWT bearer exchange, and *. Access-token lifetime is bounded from five minutes through 24 hours.

The decision identifiers are included in the access token. Verification recomputes the current policy decision and requires the same policy and rule identifiers and a lifetime no greater than the current rule. Removing a user from an allowed group therefore invalidates both refresh and subsequent access-token verification immediately.

Per-Server Signing Keys

Public key routes retain the Okta key status vocabulary:

GET /api/v1/authorizationServers/{authorizationServerId}/credentials/keys
GET /api/v1/authorizationServers/{authorizationServerId}/credentials/keys/{keyId}

Atlas returns only EC P-384 public JWK values with alg: ES384. Statuses map to ACTIVE, NEXT, and EXPIRED. Private material is generated under the gateway’s configured signing custody: either a server-bound Vault Transit envelope or a token-resident, non-extractable P-384 key addressed by an opaque CKA_ID. The selected provider applies consistently to every new default-issuer and custom-server key; it cannot change an existing key’s custody. Neither protected material nor the opaque PKCS#11 reference enters the management response. See PKCS#11 deployment contract.

Key rotation is two-stage:

POST /api/v1/authorizationServers/{authorizationServerId}/credentials/lifecycle/keyRotate
POST /api/v1/authorizationServers/{authorizationServerId}/_atlas/key-rotations/{transitionId}/approve

The stage body is:

{
  "use": "sig",
  "expectedActiveKid": "current-key-thumbprint",
  "overlapSeconds": 3600
}

Omit expectedActiveKid only for the initial key. The overlap must cover the maximum token lifetime plus clock skew and cannot exceed seven days. A different fresh phishing-resistant AAL3 actor approves. Execution is checkpointed so retry after a process failure completes the same transition without creating an extra active key.

Every rotated key records the exact immediate predecessor that it replaced. If downstream validation exposes a problem while that predecessor is still in verification overlap, rollback is also two-stage:

POST /api/v1/authorizationServers/{authorizationServerId}/credentials/lifecycle/keyRollback
POST /api/v1/authorizationServers/{authorizationServerId}/_atlas/key-rollbacks/{transitionId}/approve

The stage body names both exact versions:

{
  "use": "sig",
  "targetKid": "immediate-predecessor-thumbprint",
  "expectedActiveKid": "candidate-key-thumbprint",
  "expectedActiveVersion": 1,
  "expectedTargetVersion": 2,
  "verificationOverlapSeconds": 3600
}

Atlas refuses arbitrary historical keys, an expired predecessor, stale versions, same-actor approval, or a changed idempotent replay. Approval atomically restores the predecessor and moves the displaced candidate into a fresh bounded verification overlap; both public keys remain in JWKS so tokens issued immediately before rollback continue to verify. The database requires state-bound events plus an immutable public-only rollback receipt before it will commit any retiring to active transition. The restored key never leaves protected custody and TrustScore or other runtime evidence cannot select or activate a signing key.

The public issuer endpoints use the server ID:

GET /oauth2/{authorizationServerId}/.well-known/openid-configuration
GET /oauth2/{authorizationServerId}/v1/keys
GET /oauth2/{authorizationServerId}/v1/authorize
POST /oauth2/{authorizationServerId}/v1/token
GET /oauth2/{authorizationServerId}/v1/userinfo
POST /oauth2/{authorizationServerId}/v1/userinfo

Signing and verification query only that server’s key ring. A token from server A fails verification at server B even when both servers belong to the same tenant. Issuer and configured audience comparisons are exact.

Storage And Evidence

The aggregate is stored in icam_oidc_authorization_server_control_planes. Its JSONB payload carries an authenticated integrity seal. The seal commits:

  • the canonical configuration digest;

  • the current evidence head;

  • a deterministic semantic-JSON digest of the complete receipt map.

Each receipt separately binds tenant, authorization-server ID, idempotency lookup, operation, request digest, actor, and original response. Deleting, rekeying, editing, or copying a receipt across servers makes the aggregate unverifiable. Semantic JSON canonicalization permits PostgreSQL JSONB to normalize object ordering without weakening the seal.

icam_oidc_authorization_server_events is append-only. Every event binds tenant, server, resource, version, actor, protected reason reference, previous hash, configuration digest, and evidence hash. Database triggers lock the aggregate and require an inserted event’s version, evidence head, and state digest to equal the current aggregate. A deferred constraint also requires every aggregate insert or update to have that exact event at transaction completion. Direct aggregate advancement, future-event insertion, event update, event deletion, and physical aggregate deletion fail.

Signing keys and key events also carry the authorization-server ID. Database uniqueness permits only one active key per tenant and server, rather than one tenant-wide key.

Errors And Fail-Closed Behavior

HTTP status Meaning

400

Malformed JSON, missing mutation headers, invalid URI, unsafe claim expression, invalid scope, or a configured limit was exceeded.

403

Capability, tenant, assurance, freshness, phishing-resistant factor, or runtime-policy requirement failed.

404

The tenant cannot resolve the server or nested resource.

409

Stale ETag, conflicting idempotency binding, same-actor approval, active-server mutation, dependency, pending transition, evidence failure, or storage integrity failure.

503

The durable authority, protected payload service, directory resolver, or key custody is unavailable.

The API intentionally does not distinguish secret, identifier, grant, or policy failure at the OAuth token endpoint. Management request bodies are limited to 256 KiB. Aggregate size is limited to 1 MiB. Limit exhaustion fails rather than silently evicting integrity receipts.

OpenAPI And Compatibility

The complete management contract is available from the gateway:

GET /openapi.json
GET /swagger/

Search for the authorization servers tag. Compatibility route and field choices follow the current Okta Management OpenAPI authorization-server, scope, claim, policy, rule, and key resources. Atlas-specific approval routes and response fields are under _atlas.

Intentional security differences include:

  • ES384/P-384 server-bound keys instead of an RSA-only default;

  • inactive-only configuration;

  • ETag and idempotency headers on all mutations;

  • two-person activation, key rotation, and immediate-predecessor rollback;

  • live group reevaluation at issuance, refresh, exchange, and verification;

  • safe claim selectors instead of arbitrary expression execution;

  • sealed aggregate and receipt integrity plus database-enforced evidence coupling.

Verification

Run the focused non-container checks:

Internal implementation checks are omitted from this public guide.

The unit suite proves receipt deletion and cross-server-copy refusal, semantic JSON canonicalization, different-actor key, activation, and rollback approval, immediate-predecessor and overlap enforcement, exact rollback replay, per-server issuer and key isolation, and live group removal denial for refresh and access-token verification.

Compile the PostgreSQL path without starting containers:

Internal implementation checks are omitted from this public guide.

Run the bounded PostgreSQL gate:

ATLAS_ICAM_POSTGRES_TMPFS=true \
  scripts/test/run-authorization-server-docker-validation.sh

The bounded test applies the real embedded migrations and uses real Vault for both ES384 private-key envelopes and the PKCS#11 PIN reference. It restarts the service across issuance, rollover, and rollback and proves both old and displaced-key tokens verify during bounded overlap. The SoftHSM lane separately proves token-resident P-384 generation, null private ciphertext, opaque-only database reference custody, signing-only and never-extractable attributes, restart/reopen continuity, no software fallback on token outage, and SQL rebind/ciphertext-forgery rejection. It also proves exact rollback replay after restart, public-only immutable replay receipts, append-only evidence, and PostgreSQL rejection of direct key reactivation without a matching rollback receipt. The same run reconstructs a JSONB-normalized sealed aggregate and rejects a future evidence row, aggregate-only version advancement, and evidence deletion. The runner writes test.log and manifest.sha256 below artifacts/authorization-server-docker-validation/<run-id>/. SoftHSM proves the portable PKCS#11 interface, not acceptance of a physical HSM or its HA, backup, firmware, FIPS, and operator-ceremony controls. The latest verified manifest is recorded by the federation capability ledger.