Cloudflare Workers + Hono based SCIM 2.0 bridge for provisioning authentik users and groups into Nextcloud through the OCS Provisioning API.
This provider is stateless. It does not use Cloudflare KV or any other local state store; Nextcloud is the source of truth.
Configure public variables:
NEXTCLOUD_BASE_URL=https://cloud.example.com
NEXTCLOUD_ADMIN_USER=scim-adminConfigure secrets:
pnpm wrangler secret put SCIM_BEARER_TOKEN
pnpm wrangler secret put NEXTCLOUD_ADMIN_PASSWORDUse a dedicated Nextcloud admin account and an app password for
NEXTCLOUD_ADMIN_PASSWORD.
Set the SCIM provider URL to:
https://<worker-host>/scim/v2Use bearer-token authentication with the same value stored in
SCIM_BEARER_TOKEN.
Email is required when creating a user. The provider selects:
- the
emails[]entry withprimary: true - otherwise, the first
emails[]entry with a non-emptyvalue
If no valid email is present, user creation fails with SCIM 400 invalidValue.
The selected email is sent to Nextcloud as email, and the password field is
left empty so Nextcloud sends the welcome email/password setup link.
Email updates through SCIM PUT /Users/:id and PATCH /Users/:id are forwarded
to Nextcloud. Email removal is rejected because welcome-email provisioning and
account recovery require an email.
GET /scim/v2/ServiceProviderConfigGET /scim/v2/SchemasGET /scim/v2/ResourceTypesGET|POST /scim/v2/UsersGET|PUT|PATCH|DELETE /scim/v2/Users/:idGET|POST /scim/v2/GroupsGET|PUT|PATCH|DELETE /scim/v2/Groups/:id
Supported list filters:
userName eq "..."externalId eq "..."emails.value eq "..."displayName eq "..."
- SCIM User
idis the Nextclouduserid, derived from SCIMuserName. - The provider trusts the user ID supplied by the SCIM client.
externalId eq "..."lookups are treated as lookups by that same Nextclouduserid; arbitraryexternalIdvalues are not persisted. - User and group list responses are built by querying Nextcloud directly.
- Changing
userNameafter creation is rejected. active=falsedisables the Nextcloud user.DELETE /Users/:idalso disables the user; it never deletes Nextcloud user data.DELETE /Groups/:iddeletes the Nextcloud group only.- Bulk SCIM, Enterprise User extension fields, password sync, and subadmin management are not implemented.
pnpm install
pnpm test
pnpm exec tsc --noEmit
pnpm run dev