Liking cljdoc? Tell your friends :D

supabase.auth.admin.oauth

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.

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.
raw docstring

create-clientclj

(create-client client params)

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"]})
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"]})
sourceraw docstring

delete-clientclj

(delete-client client client-id)

Deletes the OAuth client client-id. Permanent; tokens issued to it stop working.

Example

(delete-client client "<client-id>")
Deletes the OAuth client `client-id`. Permanent; tokens issued to it stop
working.

## Example

    (delete-client client "<client-id>")
sourceraw docstring

get-clientclj

(get-client client client-id)

Fetches the OAuth client client-id.

Example

(get-client client "<client-id>")
Fetches the OAuth client `client-id`.

## Example

    (get-client client "<client-id>")
sourceraw docstring

list-clientsclj

(list-clients client)
(list-clients client opts)

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})
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})
sourceraw docstring

regenerate-client-secretclj

(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>")
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>")
sourceraw docstring

update-clientclj

(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.

Example

(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"})
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close