Skip to content

feat(auth): add the OAuth server operations - #1058

Merged
Tr00d merged 13 commits into
masterfrom
feat/oauth-server
Dec 3, 2026
Merged

Tr00d merged 13 commits into
masterfrom
feat/oauth-server

Conversation

@Tr00d

@Tr00d Tr00d commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Adds the OAuth server operations for the signed-in user: read, approve and deny an authorization request, list grants, and revoke a grant. Supersedes #818, built on @diegofesanto's commits.

Capability Method
auth.oauth_server.get_authorization_details IGotrueClient.GetAuthorizationDetailsAsync
auth.oauth_server.approve_authorization IGotrueClient.ApproveAuthorizationAsync
auth.oauth_server.deny_authorization IGotrueClient.DenyAuthorizationAsync
auth.oauth_server.list_grants IGotrueClient.ListGrantsAsync
auth.oauth_server.revoke_grant IGotrueClient.RevokeGrantAsync

New public surface, all unshipped: the five methods and their IGotrueApi twins, OAuthRedirect and OAuthAuthorizationClient (Common), OAuthAuthorizationResponse, OAuthAuthorizationDetails and OAuthAuthorizationUser (GetAuthorizationDetails), OAuthGrant (ListGrants). The twins are a second public member per operation, the cost of the existing jwt overload pattern.

Deviations from supabase-js:

  • No skipBrowserRedirect option: a .NET client does not navigate a browser.
  • Revoke takes the client id as a Guid instead of an options object.

Contract checked against the auth OpenAPI and handlers: paths, consent body, client_id query, 404 oauth_authorization_not_found / oauth_consent_not_found, 400 validation_failed for an authorization already decided.

E2E tests register their own OAuth client and authorization, so they need no seed data and can be rerun.

diegofesanto and others added 13 commits November 14, 2026 18:47
…rization

# Conflicts:
#	packages/Gotrue/Gotrue/Api.cs
#	packages/Gotrue/Gotrue/Interfaces/IGotrueApi.cs
…e OAuth server tests do not need

The E2E tests now register their own OAuth client and start their own authorization requests, so nothing is seeded.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… conventions

Use the auth.oauth_server capability keys, the Async suffix and one folder per use case.
Drop the no-op AuthorizationOptions, escape the authorization id, send typed bodies, throw GotrueException on empty answers and revoke a grant by client id.
Cover every call with contract, approval and unit tests, and make the E2E tests register their own client so they can be rerun.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ecided

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Tr00d
Tr00d marked this pull request as ready for review December 3, 2026 13:54
@Tr00d
Tr00d merged commit e3fd3d1 into master Dec 3, 2026
10 of 11 checks passed
@Tr00d
Tr00d deleted the feat/oauth-server branch December 3, 2026 14:15
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.

2 participants