Skip to content

Providers

A provider is an authentication method. FastAuth routes a request to a provider by endpoint — each provider owns a slice of the /auth/* URL space.

Provider types

Provider id auth_type Routes Extra needed
CredentialsProvider credentials credentials /auth/register, /auth/login standard (argon2)
MagicLinksProvider magic_links magic_links /auth/magic-links/login, /auth/magic-links/callback email (for SMTP)
GoogleProvider google oauth /auth/oauth/google/* oauth (httpx)
GitHubProvider github oauth /auth/oauth/github/* oauth (httpx)
PasskeyProvider passkey passkey /auth/passkeys/* webauthn

The presence of a provider in config.providers is what activates the corresponding routes:

  • CredentialsProvider enables the credentials routes (/auth/register, /auth/login, /auth/verify-email, /auth/forgot-password, /auth/reset-password). Without one, /auth/register returns 400 Credentials provider is not configured.
  • MagicLinksProvider mounts the /auth/magic-links/* router (only mounted when at least one provider is an instance of MagicLinksProvider, per api/router.py).
  • PasskeyProvider plus passkey_adapter + passkey_state_store mounts the /auth/passkeys/* router.
  • Any OAuth provider (GoogleProvider, GitHubProvider) plus oauth_adapter + oauth_state_store mounts the /auth/oauth/* router. {provider} in the URL is matched against provider.id.

Combining providers

You can — and usually should — use multiple providers at once. Registration account-linking across providers is handled by the OAuth adapter and the user-by-email lookup.

providers=[
    CredentialsProvider(),
    MagicLinksProvider(),
    GoogleProvider(client_id=..., client_secret=...),
    GitHubProvider(client_id=..., client_secret=...),
    PasskeyProvider(rp_id="example.com", rp_name="My App", origin="https://example.com"),
],

Per-provider pages