Packages

Integration with the Auth API from Supabase services. Provide authentication with MFA, password and magic link.

Current section

Files

Jump to
supabase_auth lib supabase auth schemas create_custom_provider_params.ex
Raw

lib/supabase/auth/schemas/create_custom_provider_params.ex

defmodule Supabase.Auth.Schemas.CreateCustomProviderParams do
@moduledoc false
import Ecto.Changeset
@types %{
provider_type: :string,
identifier: :string,
name: :string,
client_id: :string,
client_secret: :string,
acceptable_client_ids: {:array, :string},
scopes: {:array, :string},
pkce_enabled: :boolean,
attribute_mapping: :map,
authorization_params: :map,
enabled: :boolean,
email_optional: :boolean,
issuer: :string,
discovery_url: :string,
skip_nonce_check: :boolean,
authorization_url: :string,
token_url: :string,
userinfo_url: :string,
jwks_uri: :string
}
@required [:provider_type, :identifier, :name, :client_id, :client_secret]
@spec parse(map()) :: {:ok, map()} | {:error, Ecto.Changeset.t()}
def parse(attrs) do
{%{}, @types}
|> cast(attrs, Map.keys(@types))
|> validate_required(@required)
|> validate_inclusion(:provider_type, ~w[oauth2 oidc])
|> apply_action(:parse)
end
end