-
Notifications
You must be signed in to change notification settings - Fork 514
feat(auth): add OAuth grant listing and revocation endpoints #1833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 3 commits
74e75ce
8c13920
b136bb3
be3908f
78646e5
05b45ac
c7ea4f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1676,6 +1676,40 @@ export type AuthOAuthConsentResponse = RequestResult<{ | |
| redirect_url: string | ||
| }> | ||
|
|
||
| /** | ||
| * An OAuth grant representing a user's authorization of an OAuth client. | ||
| * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. | ||
| */ | ||
| export type OAuthGrant = { | ||
| /** OAuth client identifier (UUID) */ | ||
| client_id: string | ||
| /** Human-readable name of the OAuth client */ | ||
| client_name: string | ||
| /** URI of the OAuth client's website */ | ||
| client_uri: string | ||
| /** URI of the OAuth client's logo */ | ||
| logo_uri: string | ||
| /** Array of scopes granted to this client */ | ||
| scopes: string[] | ||
| /** Timestamp when the grant was created (ISO 8601 date-time) */ | ||
| granted_at: string | ||
| } | ||
|
|
||
| /** | ||
| * Response type for listing user's OAuth grants. | ||
| * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. | ||
| */ | ||
| export type AuthOAuthGrantsResponse = RequestResult<{ | ||
| /** Array of OAuth grants authorized by the user */ | ||
| grants: OAuthGrant[] | ||
|
||
| }> | ||
|
|
||
| /** | ||
| * Response type for revoking an OAuth grant. | ||
| * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. | ||
| */ | ||
| export type AuthOAuthRevokeGrantResponse = RequestResult<{}> | ||
|
|
||
| /** | ||
| * Contains all OAuth 2.1 authorization server user-facing methods. | ||
| * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. | ||
|
|
@@ -1722,4 +1756,25 @@ export interface AuthOAuthServerApi { | |
| authorizationId: string, | ||
| options?: { skipBrowserRedirect?: boolean } | ||
| ): Promise<AuthOAuthConsentResponse> | ||
|
|
||
| /** | ||
| * Lists all OAuth grants that the authenticated user has authorized. | ||
| * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. | ||
| * | ||
| * @returns Array of OAuth grants with client information and granted scopes | ||
| */ | ||
| listGrants(): Promise<AuthOAuthGrantsResponse> | ||
|
|
||
| /** | ||
| * Revokes a user's OAuth grant for a specific client. | ||
| * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth. | ||
| * | ||
| * Revocation marks consent as revoked, deletes active sessions for that OAuth client, | ||
| * and invalidates associated refresh tokens. | ||
| * | ||
| * @param options - Revocation options | ||
| * @param options.clientId - The OAuth client identifier (UUID) to revoke access for | ||
| * @returns Empty response on successful revocation | ||
| */ | ||
| revokeGrant(options: { clientId: string }): Promise<AuthOAuthRevokeGrantResponse> | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.