Skip to main content

Social Login Setup (Google and Apple)

Configure social login so your users can sign in with Google or Apple.

More Providers Coming Soon

Support for additional social login providers will be added in a future release.

Optional Feature

Social login is entirely optional. All providers are disabled by default. BillManager works perfectly fine with just username/password authentication.

How It Works

  1. You register BillManager as an application (OAuth client) with the identity provider
  2. You add the provider's credentials to your BillManager environment variables
  3. Users see "Sign in with ..." buttons on the login page
  4. On first social login, a BillManager account is automatically created (if OAUTH_AUTO_REGISTER is enabled)

Callback URL

Every provider will ask for a redirect URI (also called callback URL). Use:

https://your-billmanager-url.com/auth/callback

Replace your-billmanager-url.com with your actual APP_URL. This must match exactly — including the scheme (https://) and no trailing slash.

Provider Setup

Google

  1. Go to the Google Cloud Console
  2. Create a new project (or select an existing one)
  3. Go to APIs & ServicesCredentials
  4. Click Create CredentialsOAuth client ID
  5. Select Web application
  6. Add your callback URL under Authorized redirect URIs:
    https://your-billmanager-url.com/auth/callback
  7. Copy the Client ID and Client secret
environment:
- OAUTH_GOOGLE_ENABLED=true
- OAUTH_GOOGLE_CLIENT_ID=123456789-abc.apps.googleusercontent.com
- OAUTH_GOOGLE_CLIENT_SECRET=GOCSPX-your-secret

Apple

  1. Go to Apple Developer Account
  2. Register an App ID with "Sign In with Apple" capability
  3. Create a Services ID (this becomes your Client ID)
  4. Configure the Return URL (your callback URL)
  5. Create a Key with "Sign In with Apple" enabled — download the .p8 file
environment:
- OAUTH_APPLE_ENABLED=true
- OAUTH_APPLE_CLIENT_ID=com.yourdomain.billmanager
- OAUTH_APPLE_TEAM_ID=ABCDE12345
- OAUTH_APPLE_KEY_ID=KEY123456
- OAUTH_APPLE_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----\nMIGT...your-key...\n-----END PRIVATE KEY-----
Apple Private Key

The private key must be the full PEM content. In Docker Compose, use \n for newlines or mount it as a file. In Coolify/Portainer, paste it directly into the environment variable field.

More Providers

This page will be expanded as additional providers are added.

Auto-Registration

When a user signs in via a social provider for the first time, BillManager can automatically create an account for them.

VariableDescriptionDefault
OAUTH_AUTO_REGISTERCreate accounts for new social login usersfalse

When enabled:

  • A new user account is created using the provider's email
  • The username is derived from the email (before the @)
  • The user is assigned the default user role (not admin)
  • They still need a Bill Group assignment from an admin to see any bills

When disabled:

  • Only existing users can link social accounts from Admin Panel → Security
  • New users must be created by an admin first, then they can link a social provider

Two-Factor Authentication

BillManager supports two-factor authentication (2FA) with email OTP codes, passkeys (WebAuthn), and recovery codes.

Enabling 2FA

environment:
- ENABLE_2FA=true

This allows users to optionally enable 2FA on their accounts via Admin Panel → Security. It does not force 2FA — each user chooses whether to enable it.

Enabling Passkeys

Passkeys require additional configuration for WebAuthn:

environment:
- ENABLE_2FA=true
- ENABLE_PASSKEYS=true
- WEBAUTHN_RP_ID=bills.yourdomain.com
- WEBAUTHN_RP_NAME=BillManager
- WEBAUTHN_ORIGIN=https://bills.yourdomain.com
VariableDescriptionExample
WEBAUTHN_RP_IDYour domain name (no scheme, no port)bills.yourdomain.com
WEBAUTHN_RP_NAMEDisplay name shown in browser promptsBillManager
WEBAUTHN_ORIGINFull origin URL (scheme + domain, no trailing slash)https://bills.yourdomain.com
RP ID Must Match Your Domain

WEBAUTHN_RP_ID must exactly match the domain users access BillManager from. If users visit https://bills.example.com, set it to bills.example.com. Passkey registration and authentication will silently fail if this doesn't match.

Recovery Codes

Recovery codes are automatically generated when a user enables 2FA. Each user gets a set of one-time-use codes that work if they lose access to their email or passkey. No additional configuration is needed.

Environment Variable Reference

OAuth Providers

VariableRequiredDescription
OAUTH_GOOGLE_ENABLEDNoEnable Google login (true/false)
OAUTH_GOOGLE_CLIENT_IDIf enabledGoogle OAuth client ID
OAUTH_GOOGLE_CLIENT_SECRETIf enabledGoogle OAuth client secret
OAUTH_APPLE_ENABLEDNoEnable Apple login
OAUTH_APPLE_CLIENT_IDIf enabledApple Services ID
OAUTH_APPLE_TEAM_IDIf enabledApple Developer Team ID
OAUTH_APPLE_KEY_IDIf enabledApple Sign In key ID
OAUTH_APPLE_PRIVATE_KEYIf enabledApple Sign In private key (PEM)

Auto-Registration & 2FA

VariableDefaultDescription
OAUTH_AUTO_REGISTERfalseAuto-create accounts for social login users
ENABLE_2FAfalseAllow users to enable two-factor authentication
ENABLE_PASSKEYSfalseAllow passkey/WebAuthn as a 2FA method
WEBAUTHN_RP_IDDerived from APP_URLWebAuthn Relying Party ID (your domain)
WEBAUTHN_RP_NAMEBillManagerDisplay name in browser passkey prompts
WEBAUTHN_ORIGINAPP_URLFull origin URL for WebAuthn

Full Example

Here's a complete docker-compose.yml with Google/Apple login and 2FA with passkeys:

services:
billmanager:
image: ghcr.io/brdweb/billmanager:latest
ports:
- "5000:5000"
environment:
- DEPLOYMENT_MODE=self-hosted
- DATABASE_URL=postgresql://billsuser:${DB_PASSWORD}@db:5432/billmanager
- FLASK_SECRET_KEY=${FLASK_SECRET}
- JWT_SECRET_KEY=${JWT_SECRET}
- APP_URL=https://bills.yourdomain.com
# Email (required for 2FA email OTP and invitations)
- RESEND_API_KEY=${RESEND_KEY}
- [email protected]
# Google OAuth
- OAUTH_GOOGLE_ENABLED=true
- OAUTH_GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- OAUTH_GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
# Apple OAuth
- OAUTH_APPLE_ENABLED=true
- OAUTH_APPLE_CLIENT_ID=${APPLE_SERVICES_ID}
- OAUTH_APPLE_TEAM_ID=${APPLE_TEAM_ID}
- OAUTH_APPLE_KEY_ID=${APPLE_KEY_ID}
- OAUTH_APPLE_PRIVATE_KEY=${APPLE_PRIVATE_KEY}
# Two-factor authentication
- ENABLE_2FA=true
- ENABLE_PASSKEYS=true
- WEBAUTHN_RP_ID=bills.yourdomain.com
- WEBAUTHN_RP_NAME=BillManager
- WEBAUTHN_ORIGIN=https://bills.yourdomain.com
depends_on:
- db
restart: unless-stopped

db:
image: postgres:16-alpine
environment:
- POSTGRES_USER=billsuser
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=billmanager
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped

volumes:
postgres_data: