Skip to content

feat: SCIM discovery endpoints - #2643

Open
xlgmokha wants to merge 1 commit into
masterfrom
xlgmokha/auth-1362
Open

feat: SCIM discovery endpoints#2643
xlgmokha wants to merge 1 commit into
masterfrom
xlgmokha/auth-1362

Conversation

@xlgmokha

@xlgmokha xlgmokha commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

This change implements the SCIM discovery/metadata endpoints behind the experimental feature flag from #2639:

  • GET /scim/v2/ServiceProviderConfig
  • GET /scim/v2/ResourceTypes
  • GET /scim/v2/Schemas

These replace the 501 Not Implemented stubs with spec-compliant JSON responses.

https://linear.app/supabase/issue/AUTH-1362/scim-discovery-endpoints

What is the current behavior?

With #2639 alone, the three routes above mount when the flag is on, but each just returns a bare 501 with no body.

What is the new behavior?

Each endpoint now returns real RFC 7643-compliant JSON responses:

  • ServiceProviderConfig reports this server's actual current capabilities. (authenticationSchemes user bearer-token scheme that a later PR will enforce.)
  • ResourceTypes and Schemas return an empty Resources: [] list, since no resource types (Users, Groups) exist yet.

Nothing here is reachable unless GOTRUE_EXPERIMENTAL_SCIM_ENABLED is set.

GET /scim/v2/ServiceProviderConfig

モ curl http://localhost:9999/scim/v2/ServiceProviderConfig | jq '.'
{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"
  ],
  "patch": {
    "supported": false
  },
  "bulk": {
    "supported": false,
    "maxOperations": 0,
    "maxPayloadSize": 0
  },
  "filter": {
    "supported": false,
    "maxResults": 0
  },
  "changePassword": {
    "supported": false
  },
  "sort": {
    "supported": false
  },
  "etag": {
    "supported": false
  },
  "authenticationSchemes": [
    {
      "type": "oauthbearertoken",
      "name": "OAuth Bearer Token",
      "description": "Authentication scheme using the OAuth Bearer Token Standard",
      "specUri": "http://www.rfc-editor.org/info/rfc6750",
      "primary": true
    }
  ],
  "meta": {
    "resourceType": "ServiceProviderConfig",
    "location": "http://localhost:9999/scim/v2/ServiceProviderConfig"
  }
}

GET /scim/v2/ResourceTypes

モ curl http://localhost:9999/scim/v2/ResourceTypes | jq '.'
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "totalResults": 0,
  "startIndex": 1,
  "itemsPerPage": 0,
  "Resources": []
}

GET /scim/v2/Schemas

モ curl http://localhost:9999/scim/v2/Schemas | jq '.'
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "totalResults": 0,
  "startIndex": 1,
  "itemsPerPage": 0,
  "Resources": []
}

404 Error:

モ curl http://localhost:9999/scim/v2/ | jq '.'
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error"
  ],
  "detail": "Endpoint or resource does not exist",
  "status": "404"
}

405 Error:

モ curl -XPOST http://localhost:9999/scim/v2/ResourceTypes | jq '.'
{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:Error"
  ],
  "detail": "The request method is not supported by this endpoint",
  "status": "405"
}

Additional context

@xlgmokha xlgmokha changed the title feat: SCIM discover endpoints feat: SCIM discovery endpoints Jul 27, 2026
@xlgmokha
xlgmokha force-pushed the xlgmokha/auth-1361 branch 4 times, most recently from 27f6093 to 8b11a0d Compare July 27, 2026 16:53
@xlgmokha
xlgmokha force-pushed the xlgmokha/auth-1362 branch 2 times, most recently from c9efa6c to 4a4002e Compare July 27, 2026 21:17
Base automatically changed from xlgmokha/auth-1361 to master July 28, 2026 13:39
@xlgmokha
xlgmokha force-pushed the xlgmokha/auth-1362 branch 4 times, most recently from b31d174 to e53a795 Compare July 28, 2026 21:50
@blacksmith-sh

This comment has been minimized.

@xlgmokha
xlgmokha force-pushed the xlgmokha/auth-1362 branch 8 times, most recently from 57d2422 to a4e9939 Compare July 29, 2026 21:00
@xlgmokha xlgmokha self-assigned this Jul 29, 2026
@xlgmokha
xlgmokha marked this pull request as ready for review July 29, 2026 21:19
@xlgmokha
xlgmokha requested a review from a team as a code owner July 29, 2026 21:19
@xlgmokha
xlgmokha force-pushed the xlgmokha/auth-1362 branch 6 times, most recently from 91eecb6 to 85b0e52 Compare July 29, 2026 22:03
Implement the SCIM 2.0 discovery endpoints from RFC 7644:

- GET /scim/v2/ServiceProviderConfig
- GET /scim/v2/ResourceTypes
- GET /scim/v2/Schemas

ServiceProviderConfig reports the required attributes from RFC 7643
and advertises the OAuth bearer token scheme.

Errors under `/scim/v2` use the RFC 7644 error form, served as
`application/scim+json`:

- 403: with scimType invalidFilter for a filtered discovery query
- 404: for an unknown endpoint or resource
- 405: with an Allow header, for an unsupported method

Nothing is reachable unless `GOTRUE_EXPERIMENTAL_SCIM_ENABLED` is set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant