Testing Okta SCIM Provisioning Against a Local Simulator
A stateful simulator makes SCIM lifecycle tests repeatable without a playground or tunnel.

Testing Okta SCIM provisioning against a local simulator tests continuity as well as response format. Only a stateful simulator can stand in for a live SCIM server across creation, profile updates, deactivation, and reactivation. It makes those transitions repeatable without a cloud playground or tunnel, provided that local lifecycle tests remain distinct from live Okta integration checks and that the simulator’s fidelity is continuously verified.
Why SCIM provisioning is sequential and what that demands from a test environment
A provisioning operation changes the conditions under which the next operation runs. Creating a user leaves a record with a server-assigned ID. Updating that user must locate the same record and change its attributes. Deactivation must change its active state, and reactivation must change it back while keeping the record’s identity. The test target must remember what happened in earlier requests as well as return a response for each endpoint.
Okta’s SCIM test method table names these responsibilities separately through methods including createNewUser, pushProfileUpdate, activateUser, deactivateUser, and reactivateUser. Their individual responses matter, but a lifecycle test must also exercise their dependencies in order. A successful update means something different when it changes a previously created user than when it returns a fixed example.
What Okta actually sends to a SCIM server, and the full sequence a compliant server must handle
Okta’s SCIM build guide requires a TLS-secured base URL and suggests /scim/v2/. It supports authentication through the OAuth 2.0 authorization code flow, Basic Auth, or an HTTP Authorization header. In Okta provisioning, the service provider assigns each resource its unique identifier. The guide recommends against using an email address for that identifier because email addresses change. Its Basic User Schema requirements include userName, name.givenName, name.familyName, and emails, with a separate active attribute for active resources.
The user creation sequence begins with GET /Users?filter=userName=… to check whether the user already exists. Creation then uses POST /Users, and the server returns the ID that later operations address. Profile updates use PUT /Users/<id> to change the attributes that are stored for the user. Deactivation and reactivation use that same resource path with the active attribute set to false or true. The test must use the returned identifier to link these requests and check that they work together.
The broader provisioning surface extends beyond this user lifecycle. Okta’s SCIM 2.0 Test App exposes capabilities including Push New Users, Push Profile Updates, Push Groups, Group Linking, Schema Discovery, Attribute Writeback, and Deactivate. SonarQube’s Okta integration likewise treats Create Users, Update User Attributes, and Deactivate Users as distinct provisioning actions.
Why the SCIM Playground and ngrok tunnels fall short as a test foundation
The SCIM Playground is useful for initial exploration, but its operating model does not provide a self-contained CI environment. Okta’s guide describes ephemeral API keys with configurable expiry and instructs developers to store the key externally for future reference. Seeded users, groups, and assignments are kept on shared remote infrastructure that the developer cannot snapshot or restore. Every build using that target also depends on an outbound call to scim.dev. The guide also says to use only test data.
An ngrok tunnel lets Okta reach a local server, but it still requires an internet connection and a stable address. The URL can change on restart unless a static dev domain or custom domain is configured. ngrok includes a free dev domain on all plans, so a stable address does not inherently require payment. Even with that address, each CI worker needs its own tunnel, and the server is reachable by anyone who knows the URL.
Neither approach should be confused with a stateless stub. A remote playground or tunneled server may keep records, but each test job still needs its own state that it can reset. Okta’s scim-sdk-tests.jar serves a different purpose by checking individual methods against a server endpoint. Those checks complement lifecycle testing, but they do not replace a provisioning sequence in which each call depends on the previous result.
What statelessness costs in SCIM testing, specifically
The narrower defect of a stateless target is that its answer cannot depend on what happened before. A fixed response is the same whether an update is for a user that exists or one that was never created. It cannot return both a missing-user 404 and the updated fields of a record that was changed. Schema conformance does not close that gap. A response can contain the required user attributes without proving that any stored user changed.
Okta’s createNewUser method first filters users by userName, so the answer must depend on the current population. A stub that always reports no match never exercises the duplicate-handling path. Group updates also depend on earlier requests because adding a member must refer to a user record that was created earlier. The test needs to keep user and group state to check that memberships stay consistent across those operations.
Deactivation and reactivation also lose their meaning when the target cannot remember the prior active state. Both can get responses that look right even though no flag ever changes. Pagination makes the missing state visible across a collection. Okta’s downloadUsers method requests GET /Users?startIndex=1&count=100, which requires a known population against which the returned page can be checked.
What a stateful local SCIM simulator needs to do to replace the live server faithfully
When it creates a user, it must generate and own the server-assigned ID, return it, and make the record available to subsequent GET, PUT, and DELETE calls. Filter queries must search the actual stored population. Changes to the profile and active-state must change that same record. Group operations must work against the users and memberships in the simulator’s current state.
The simulator must also cover the provisioning actions under test, including Push New Users, Push Profile Updates, Push Groups, Group Linking, and Deactivate. Supporting requests in different orders means responding according to the state that exists when each request arrives. Pre-seeded users and groups give tests a realistic starting point, so each test can run without having to create all its users and groups. A deterministic reset then restores that starting point by seed or snapshot.
Local execution completes the test foundation by removing live credentials and internet access from the lifecycle suite. The simulator should run locally or as a container service, including in environments with air-gap constraints. It must also support deliberate fault injection through latency, 429 rate-limit responses, and 503 service-unavailable responses. These capabilities make failure conditions reproducible without an external outage. They are requirements for the simulator that go beyond a target's acceptance of SCIM requests.
Running the full Okta SCIM provisioning lifecycle against a local simulator
The workflow begins by starting the simulator with a known seed and a SCIM 2.0 base URL on localhost. Local development need not require TLS, although the simulator should support TLS where the environment requires it. There is an important network boundary here. SonarQube’s SCIM documentation states that provisioning requires a direct network connection from the identity provider to the application. A localhost address alone therefore does not make the simulator reachable by hosted Okta, and a live Okta-driven test is not an entirely offline workflow.
For the live integration check, Okta must have a reachable simulator endpoint that meets its connection requirements. The Admin Console setup uses a SAML 2.0 app integration or the SCIM 2.0 Test App template, with the SCIM connector base URL set to that endpoint. The unique identifier field is userName, and the simulator still owns the resource ID it returns. HTTP Header authentication can use a static test token. The provisioning actions for this check are Create Users, Update User Attributes, Deactivate Users, and Push Groups.
The lifecycle itself starts with a user assignment, followed by the filtered lookup and creation request. The simulator stores the user and returns its ID, after which a profile update must mutate that record through PUT /Users/<id>. Deactivation must set active to false, and a subsequent read must reflect the change. Reactivation must set it back to true on the same resource. Querying the simulator after each transition verifies the cumulative result.
For a self-contained local run, the lifecycle test suite sends this sequence directly to the simulator without invoking hosted Okta. That exercises the dependent operations without an outbound connection, but it does not prove that Okta itself issued them correctly. Run scim-sdk-tests.jar against the same target for individual method and schema checks. Keep those results distinct from both the local lifecycle results and the live Okta integration results, because each establishes a different part of correctness.
Fitting the simulator into CI so the lifecycle test runs on every push
The local lifecycle suite can become a CI check by declaring the simulator as a service container in the job. GitHub Actions services or an equivalent facility provides the running target, and the suite points its base URL at the exposed port. This arrangement removes playground keys and tunnels from the per-push test path. It also keeps the stateful dependency inside the job that uses it.
Each job must start from a known seed so that records created during an earlier run cannot change its results. This matters directly to SCIM because an unexpected existing user changes the answer to the initial duplicate lookup. For the same reason, workers that run in parallel each need their own simulator instance with its own in-memory store. Identical seeds then provide identical starting conditions without making the workers share mutable records.
Fault injection can run as a separate CI job against the same provisioning paths. Configured latency and 429 responses let the suite test retry behavior and handling of Retry-After headers without changing production infrastructure. The SDK test jar can run as another step against the simulator container.
The drift risk: why a simulator must be continuously verified against Okta's real SCIM behavior
Repeatability is valuable only when the repeated behavior is faithful. A simulator that silently diverges from Okta can make an incomplete test look comprehensive. Okta’s SCIM reference documentation remains the authoritative description, and that description can change. Statefulness prevents one class of testing error, but it does not establish that every implemented operation matches the real integration. Fidelity must be checked and kept up to date as part of each simulator release.
The Slack emulator example illustrates the risk precisely. If a bot mention produces only a message event when it should also produce an app_mention event, the test never exercises the behavior triggered by that second event. The simulator can remain internally consistent while omitting a necessary part of the interaction. SCIM sequences and responses can leave out needed behavior in the same way.
Before every simulator release, automated verification should test every method it supports and compare the results with what happens in the matching live Okta SCIM interactions. Divergence should be documented and block the release. This live verification is kept separate from the offline per-push suite so that local tests stay repeatable while the model is checked against live behavior. Published, current fidelity scores provide a stronger basis for trust than an unverified hand-rolled Flask stub or an outdated community mock. The sound foundation is therefore not state alone, but stateful testing whose correspondence with Okta is repeatedly earned.


