Repository navigation
feat(auth): delete a custom OAuth/OIDC provider as an admin - #581
Merged
Merged
Conversation
Tr00d
marked this pull request as ready for review
October 29, 2026 09:35
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Admins can delete a custom OAuth/OIDC provider by its identifier.
Capability:
auth.admin.delete_provider— Admin Delete Provider.Public API
IGotrueApi<TUser, TSession>gains the matchingDeleteCustomProviderAsync(string jwt, string identifier, CancellationToken).Behavior
DELETE /admin/custom-providers/{identifier}with the service-role keyidentifier, required, starting withcustom:ArgumentNullExceptionfornull;ArgumentExceptionwhen the identifier lacks the case-sensitivecustom:prefix (pre-empts 400validation_failed) or contains/,\,?,#or%GotrueException:Reason = CustomProviderNotFoundon 404custom_provider_not_found;Reason = AdminTokenRequiredon 403not_admin;ErrorCode = feature_disabledon 404 when custom providers are disabledThe identifier is a path segment, and
System.Uriresolves dot segments: without the character check,custom:x/../../users/<id>becomesDELETE /admin/users/<id>. Encoding does not help, because the auth server matches the raw path and rejectscustom%3A…. The check rejects only route-changing characters, not the stricter OpenAPI pattern^custom:[a-zA-Z0-9_-]+$: the server only enforces the prefix, so a stricter check could block deleting a provider it accepted.Deviations from supabase-js
supabase-js interpolates the identifier into the URL without encoding or validation. This SDK rejects identifiers that would change the route before sending anything.
Tests
AdminCustomProviderTestsCustomProviderNotFound; non-admin key →AdminTokenRequiredAdminCustomProviderContractTestsFailureHintTestscustom_provider_not_found→CustomProviderNotFoundAdminCustomProviderIdentifierTestsChanged-line coverage: 100% (13 lines). Mutation: 11/11 killed on changed lines, 0 survivors.
No wire-shape approval snapshot: the request has no body.
Notes
GOTRUE_CUSTOM_OAUTH_ENABLEDdefaults totrue), so the local stack needs no configuration. The E2E tests seed providers withexample.comURLs because the server resolves provider hostnames on create.feature_disabled, and its identifier pattern is stricter than the server's prefix-only check.