Skip to content

feat(auth): add custom OIDC/OAuth provider admin CRUD methods#2133

Merged
mandarini merged 5 commits intomasterfrom
cemal/feat-auth-custom-oidc-providers
Feb 27, 2026
Merged

feat(auth): add custom OIDC/OAuth provider admin CRUD methods#2133
mandarini merged 5 commits intomasterfrom
cemal/feat-auth-custom-oidc-providers

Conversation

@cemalkilic
Copy link
Contributor

Add customProviders namespace to GoTrueAdminApi with listProviders, createProvider, getProvider, updateProvider, and deleteProvider methods for managing custom identity providers.

reference openapi changes: https://github.com/supabase/auth/pull/2357/changes#diff-d910ba2ef878f7db0223a966b81c8b3f3b65027bb39e4431bb05140171eece39

@cemalkilic cemalkilic requested review from a team as code owners February 24, 2026 08:38
@github-actions github-actions bot added the auth-js Related to the auth-js library. label Feb 24, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Cache: Disabled due to Reviews > Disable Cache setting

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8534ea9 and 54b69c7.

📒 Files selected for processing (2)
  • packages/core/auth-js/src/GoTrueAdminApi.ts
  • packages/core/auth-js/src/lib/types.ts

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added admin API for managing custom OAuth/OIDC providers: create, list, retrieve, update, delete.
    • New request/response types provide consistent structured results and error handling for provider operations.
    • Admin operations remain server-only to protect credentials and sensitive roles.
    • Public API extended while maintaining backward compatibility with existing integrations.

Walkthrough

This change adds a new admin surface to GoTrueAdminApi: customProviders, enabling create, list, get, update, and delete operations against /admin/custom-providers. It introduces types for provider shape and params (OIDC/OAuth), exposes a GoTrueAdminCustomProvidersApi interface, and implements server-side methods that call the admin endpoints, map responses to public types, and return structured results or auth errors consistent with existing admin patterns.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant AdminSDK as GoTrueAdminApi.customProviders
  participant Server as GoTrue Admin Server (/admin/custom-providers)
  participant DB
  Client->>AdminSDK: createProvider(params) / listProviders(...) / getProvider(id) / updateProvider(id, params) / deleteProvider(id)
  AdminSDK->>Server: HTTP POST/GET/PUT/DELETE /admin/custom-providers[/:id] (service_role auth)
  Server->>Server: validate service_role token
  alt auth valid
    Server->>DB: perform create/list/get/update/delete
    DB-->>Server: operation result
    Server-->>AdminSDK: 200/201 + response payload
    AdminSDK-->>Client: return transformed response { data, error }
  else auth error
    Server-->>AdminSDK: 401/403 error
    AdminSDK-->>Client: return structured auth error (no service_role exposed)
  end
Loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 24, 2026

Open in StackBlitz

@supabase/auth-js

npm i https://pkg.pr.new/@supabase/auth-js@2133

@supabase/functions-js

npm i https://pkg.pr.new/@supabase/functions-js@2133

@supabase/postgrest-js

npm i https://pkg.pr.new/@supabase/postgrest-js@2133

@supabase/realtime-js

npm i https://pkg.pr.new/@supabase/realtime-js@2133

@supabase/storage-js

npm i https://pkg.pr.new/@supabase/storage-js@2133

@supabase/supabase-js

npm i https://pkg.pr.new/@supabase/supabase-js@2133

commit: 8369a5b

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/core/auth-js/src/GoTrueAdminApi.ts`:
- Around line 606-618: Update the xform passed to _request in the GET
/admin/custom-providers call inside GoTrueAdminApi so it defensively defaults
providers to an empty array; specifically modify the xform function (the arrow
passed as xform) to return { data: { providers: data?.providers ?? [] }, error:
null } (or equivalent null/undefined-safe fallback) so callers never receive
providers as undefined while keeping the existing error-path fallback intact.

ℹ️ Review info

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Cache: Disabled due to Reviews > Disable Cache setting

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a808c54 and 733012c.

📒 Files selected for processing (2)
  • packages/core/auth-js/src/GoTrueAdminApi.ts
  • packages/core/auth-js/src/lib/types.ts

@cemalkilic cemalkilic added the do-not-merge Do not merge this PR. label Feb 24, 2026
@cemalkilic cemalkilic removed the do-not-merge Do not merge this PR. label Feb 26, 2026
mandarini
mandarini previously approved these changes Feb 26, 2026
mandarini
mandarini previously approved these changes Feb 26, 2026
@mandarini mandarini merged commit c1613a0 into master Feb 27, 2026
22 of 26 checks passed
@mandarini mandarini deleted the cemal/feat-auth-custom-oidc-providers branch February 27, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth-js Related to the auth-js library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants