[PR #5685] feat: adding support for SCIM provisioning #14405

Closed
opened 2026-04-13 09:27:29 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5685

State: closed
Merged: Yes


What is changing?
Adding a new scim plugin which will expose a fully functional SCIM server that third party identity providers can use to provision users from their systems.

This is pretty much WIP, but wanted to get some initial feedback before further iterating and implementing the missing parts:

TODO:

  • Add tests
  • Tests against DummyIDP
  • Add more docs
  • Add metadata endpoints

Closes: #3276


Summary by cubic

Adds SCIM provisioning with a new plugin exposing SCIM 2.0 user endpoints and bearer token auth. Includes metadata endpoints and docs; tokens are generated via POST /api/auth/scim/generate-token and can be scoped to an organization.

  • New Features

    • New @better-auth/scim plugin with SCIM 2.0 user endpoints: list (basic filter), get, create, update, patch, delete.
    • Bearer token auth via scimProvider; tokens generated with POST /api/auth/scim/generate-token (session required) and endpoints are restricted to the issuing provider and optional organization scope.
    • SCIM metadata endpoints: ServiceProviderConfig, Schemas, ResourceTypes; docs include a SCIM setup guide.
    • Configurable token storage: plain, hashed, encrypted, or custom via storeSCIMToken.
    • Flexible hooks to control SCIM token generation and access (before/after generate).
    • Automatic account linking and organization membership when using an org-scoped token.
    • scimClient helper for Better Auth clients to enable token generation from the client (session required).
  • Migration

    • Install @better-auth/scim and add scim() to plugins.
    • Migrate the database to add the scimProvider table/fields.
    • Generate a SCIM token via POST /api/auth/scim/generate-token and share the SCIM base URL and token with your IdP.

Written for commit 8c7fd39275. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5685 **State:** closed **Merged:** Yes --- **What is changing?** Adding a new `scim` plugin which will expose a fully functional `SCIM` server that third party identity providers can use to provision users from their systems. This is pretty much WIP, but wanted to get some initial feedback before further iterating and implementing the missing parts: **TODO**: - [x] Add tests - [x] Tests against DummyIDP - [x] Add more docs - [x] Add metadata endpoints Closes: #3276 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds SCIM provisioning with a new plugin exposing SCIM 2.0 user endpoints and bearer token auth. Includes metadata endpoints and docs; tokens are generated via POST /api/auth/scim/generate-token and can be scoped to an organization. - **New Features** - New @better-auth/scim plugin with SCIM 2.0 user endpoints: list (basic filter), get, create, update, patch, delete. - Bearer token auth via scimProvider; tokens generated with POST /api/auth/scim/generate-token (session required) and endpoints are restricted to the issuing provider and optional organization scope. - SCIM metadata endpoints: ServiceProviderConfig, Schemas, ResourceTypes; docs include a SCIM setup guide. - Configurable token storage: plain, hashed, encrypted, or custom via storeSCIMToken. - Flexible hooks to control SCIM token generation and access (before/after generate). - Automatic account linking and organization membership when using an org-scoped token. - scimClient helper for Better Auth clients to enable token generation from the client (session required). - **Migration** - Install @better-auth/scim and add scim() to plugins. - Migrate the database to add the scimProvider table/fields. - Generate a SCIM token via POST /api/auth/scim/generate-token and share the SCIM base URL and token with your IdP. <sup>Written for commit 8c7fd392756cfeaddbc970f8c4a0d74a9df460cf. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:27:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14405