Supabase. Auth. Types. Provider
(supabase_auth v1.0.1)
View Source
Custom Ecto type for OAuth provider validation.
Supports both built-in providers and custom providers.
Built-in providers can be passed as atoms (:github) or strings ("github").
Inputs are normalized to lowercase before validation.
Custom providers must use the custom:identifier format with lowercase identifiers.
Built-in providers are represented as atoms in Elixir (for backward compatibility). Custom providers are represented as strings.
Built-in Providers
apple, azure, bitbucket, discord, email, facebook, figma, github, gitlab, google, kakao, keycloak, linkedin, linkedin_oidc, notion, phone, slack, spotify, twitch, twitter, workos, zoom, fly
Custom Providers
Custom providers use lowercase identifiers in the format custom:identifier. For example:
"custom:mycompany""custom:sso-provider"
Examples
iex> cast(:github)
{:ok, :github}
iex> cast("google")
{:ok, :google}
iex> cast("invalid:provider")
:error
Summary
Functions
Returns the list of built-in provider names.
Casts the value to a provider.
Callback implementation for Ecto.Type.dump/1.
Callback implementation for Ecto.Type.embed_as/1.
Callback implementation for Ecto.Type.equal?/2.
Callback implementation for Ecto.Type.load/1.
Callback implementation for Ecto.Type.type/0.
Checks if a provider identifier is valid.
Functions
@spec builtins() :: [atom()]
Returns the list of built-in provider names.
Casts the value to a provider.
Accepts atoms (for built-in providers) and strings (for both built-in and custom). String inputs are trimmed and lowercased before validation.
Callback implementation for Ecto.Type.dump/1.
Callback implementation for Ecto.Type.embed_as/1.
Callback implementation for Ecto.Type.equal?/2.
Callback implementation for Ecto.Type.load/1.
@spec type() :: :string
Callback implementation for Ecto.Type.type/0.
Checks if a provider identifier is valid.
Built-in providers must be in the known list.
Custom providers must match lowercase custom:identifier.
Expects a normalized lowercase provider string.