OAuth 2.1 client administration against the Supabase Auth API.
Manages the OAuth clients registered on the project (dynamic client registration), used when the Supabase project acts as an OAuth authorization server.
Like the rest of supabase.auth.admin, every function requires a client
configured with the project's service-role key.
(require '[supabase.core.client :as client]
'[supabase.auth.admin.oauth :as oauth])
(def c (client/make-client "https://abc.supabase.co" "service-role-key"))
(oauth/create-client c {:client-name "my-app"
:redirect-uris ["https://app.example.com/cb"]})
(oauth/list-clients c)
Each function returns {:status :body :headers} on success or an anomaly
map on failure.
OAuth 2.1 client administration against the Supabase Auth API.
Manages the OAuth clients registered on the project (dynamic client
registration), used when the Supabase project acts as an OAuth
authorization server.
Like the rest of `supabase.auth.admin`, every function requires a client
configured with the project's **service-role** key.
## Example
(require '[supabase.core.client :as client]
'[supabase.auth.admin.oauth :as oauth])
(def c (client/make-client "https://abc.supabase.co" "service-role-key"))
(oauth/create-client c {:client-name "my-app"
:redirect-uris ["https://app.example.com/cb"]})
(oauth/list-clients c)
Each function returns `{:status :body :headers}` on success or an anomaly
map on failure.(create-client client params)Registers a new OAuth client. The response body carries the generated
:client_id and — shown only once — the :client_secret.
client — service-role clientparams:
:client-name — human-readable name (required):redirect-uris — allowed redirect URIs, at least one (required):client-uri — homepage of the client application:grant-types — e.g. ["authorization_code" "refresh_token"]:response-types — e.g. ["code"]:scope — space-separated scope string:token-endpoint-auth-method — e.g. "client_secret_basic"(create-client client {:client-name "my-app"
:redirect-uris ["https://app.example.com/cb"]})
Registers a new OAuth client. The response body carries the generated
`:client_id` and — shown only once — the `:client_secret`.
## Parameters
* `client` — service-role client
* `params`:
* `:client-name` — human-readable name (required)
* `:redirect-uris` — allowed redirect URIs, at least one (required)
* `:client-uri` — homepage of the client application
* `:grant-types` — e.g. `["authorization_code" "refresh_token"]`
* `:response-types` — e.g. `["code"]`
* `:scope` — space-separated scope string
* `:token-endpoint-auth-method` — e.g. `"client_secret_basic"`
## Example
(create-client client {:client-name "my-app"
:redirect-uris ["https://app.example.com/cb"]})(delete-client client client-id)Deletes the OAuth client client-id. Permanent; tokens issued to it stop
working.
(delete-client client "<client-id>")
Deletes the OAuth client `client-id`. Permanent; tokens issued to it stop
working.
## Example
(delete-client client "<client-id>")(get-client client client-id)Fetches the OAuth client `client-id`.
## Example
(get-client client "<client-id>")(list-clients client)(list-clients client opts)Lists the registered OAuth clients, paginated.
client — service-role clientopts (optional): :page (1-based) and :per-page(list-clients client)
(list-clients client {:page 2 :per-page 50})
Lists the registered OAuth clients, paginated.
## Parameters
* `client` — service-role client
* `opts` (optional): `:page` (1-based) and `:per-page`
## Example
(list-clients client)
(list-clients client {:page 2 :per-page 50})(regenerate-client-secret client client-id)Regenerates the secret for OAuth client client-id. The old secret stops
working immediately; the new one is in the response body, shown only once.
(regenerate-client-secret client "<client-id>")
Regenerates the secret for OAuth client `client-id`. The old secret stops
working immediately; the new one is in the response body, shown only once.
## Example
(regenerate-client-secret client "<client-id>")(update-client client client-id params)Updates the OAuth client client-id with params — any of
:client-name, :client-uri, :logo-uri, :redirect-uris,
:grant-types, :token-endpoint-auth-method.
(update-client client "<client-id>" {:client-name "renamed"})
Updates the OAuth client `client-id` with `params` — any of
`:client-name`, `:client-uri`, `:logo-uri`, `:redirect-uris`,
`:grant-types`, `:token-endpoint-auth-method`.
## Example
(update-client client "<client-id>" {:client-name "renamed"})cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |