Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

test-scim

A SCIM 2.0 server for user provisioning from Okta (or any SCIM client), backed by Val Town SQLite.

Connecting Okta

In Okta's SCIM provisioning settings:

FieldValue
SCIM base URLhttps://robyz7--d1499f0064e311f18c2c1607ee4eb77e.web.val.run
Unique identifieruserName
Auth modeHTTP Header
Authorization headerBearer <SCIM_TOKEN>

The bearer token is read from the SCIM_TOKEN environment variable.

šŸ‘‰ Set/rotate the token here: https://www.val.town/x/robyz7/test-scim/environment-variables?key=SCIM_TOKEN

Supported operations

MethodPathPurpose
GET/ServiceProviderConfigCapability discovery
GET/ResourceTypesResource type discovery
GET/UsersList users (supports ?filter=userName eq "...")
GET/Users/:idFetch one user
POST/UsersCreate user (409 if userName exists)
PUT/Users/:idFull replace
PATCH/Users/:idPartial update (e.g. deactivate via active:false)
DELETE/Users/:idHard delete (204)

Architecture

Rendering mermaid diagram...

Files

  • main.ts — HTTP entrypoint: bearer-token auth middleware + all SCIM routes.
  • scim.ts — Converts between DB rows and SCIM JSON; filter parsing; error shapes.
  • db.ts — SQLite schema (scim_users) and CRUD helpers.

Notes

  • Deactivation: Okta sends PATCH with active:false to offboard a user; the row is kept but marked inactive. A separate DELETE removes it entirely.
  • The legacy hardcoded john.doe / jane.smith demo users are gone — data is now persisted per real provisioning events.