Liking cljdoc? Tell your friends :D

supabase.auth.admin.custom-providers

Custom OAuth2 / OIDC provider administration against the Supabase Auth API.

Registers and manages identity providers beyond the built-in social login list, e.g. a private OIDC issuer or a partner's OAuth2 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.custom-providers :as providers])

(def c (client/make-client "https://abc.supabase.co" "service-role-key"))

(providers/create-provider c {:provider-type "oidc"
                              :identifier "acme"
                              :name "Acme SSO"
                              :client-id "client-id"
                              :client-secret "client-secret"
                              :discovery-url "https://sso.acme.com/.well-known/openid-configuration"})
(providers/list-providers c)

Each function returns {:status :body :headers} on success or an anomaly map on failure.

Custom OAuth2 / OIDC provider administration against the Supabase Auth API.

Registers and manages identity providers beyond the built-in social login
list, e.g. a private OIDC issuer or a partner's OAuth2 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.custom-providers :as providers])

    (def c (client/make-client "https://abc.supabase.co" "service-role-key"))

    (providers/create-provider c {:provider-type "oidc"
                                  :identifier "acme"
                                  :name "Acme SSO"
                                  :client-id "client-id"
                                  :client-secret "client-secret"
                                  :discovery-url "https://sso.acme.com/.well-known/openid-configuration"})
    (providers/list-providers c)

Each function returns `{:status :body :headers}` on success or an anomaly
map on failure.
raw docstring

create-providerclj

(create-provider client params)

Registers a new custom provider.

Parameters

  • client — service-role client
  • params:
    • :provider-type"oauth2" or "oidc" (required)
    • :identifier — unique slug used in sign-in URLs (required)
    • :name — display name (required)
    • :client-id / :client-secret — credentials at the provider (required)
    • :discovery-url — OIDC discovery document (oidc)
    • :issuer — expected iss claim (oidc)
    • :authorization-url / :token-url / :userinfo-url / :jwks-uri — explicit endpoints (oauth2, or oidc without discovery)
    • :acceptable-client-ids, :scopes, :pkce-enabled, :attribute-mapping, :authorization-params, :enabled, :email-optional, :skip-nonce-check — optional behavior tuning

Example

(create-provider client {:provider-type "oidc" :identifier "acme"
                         :name "Acme SSO" :client-id "id"
                         :client-secret "secret"})
Registers a new custom provider.

## Parameters

* `client` — service-role client
* `params`:
  * `:provider-type` — `"oauth2"` or `"oidc"` (required)
  * `:identifier` — unique slug used in sign-in URLs (required)
  * `:name` — display name (required)
  * `:client-id` / `:client-secret` — credentials at the provider (required)
  * `:discovery-url` — OIDC discovery document (oidc)
  * `:issuer` — expected `iss` claim (oidc)
  * `:authorization-url` / `:token-url` / `:userinfo-url` / `:jwks-uri` —
    explicit endpoints (oauth2, or oidc without discovery)
  * `:acceptable-client-ids`, `:scopes`, `:pkce-enabled`,
    `:attribute-mapping`, `:authorization-params`, `:enabled`,
    `:email-optional`, `:skip-nonce-check` — optional behavior tuning

## Example

    (create-provider client {:provider-type "oidc" :identifier "acme"
                             :name "Acme SSO" :client-id "id"
                             :client-secret "secret"})
sourceraw docstring

delete-providerclj

(delete-provider client identifier)

Deletes the custom provider identifier. Permanent; sign-ins through it stop working.

Example

(delete-provider client "acme")
Deletes the custom provider `identifier`. Permanent; sign-ins through it
stop working.

## Example

    (delete-provider client "acme")
sourceraw docstring

get-providerclj

(get-provider client identifier)

Fetches the custom provider registered under identifier.

Example

(get-provider client "acme")
Fetches the custom provider registered under `identifier`.

## Example

    (get-provider client "acme")
sourceraw docstring

list-providersclj

(list-providers client)
(list-providers client opts)

Lists the registered custom providers. Pass :type ("oauth2" or "oidc") to filter.

Example

(list-providers client)
(list-providers client {:type "oidc"})
Lists the registered custom providers. Pass `:type` (`"oauth2"` or
`"oidc"`) to filter.

## Example

    (list-providers client)
    (list-providers client {:type "oidc"})
sourceraw docstring

update-providerclj

(update-provider client identifier params)

Updates the custom provider identifier with params — same keys as create-provider except :provider-type and :identifier, which are immutable.

Example

(update-provider client "acme" {:enabled false})
Updates the custom provider `identifier` with `params` — same keys as
`create-provider` except `:provider-type` and `:identifier`, which are
immutable.

## Example

    (update-provider client "acme" {:enabled false})
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