Documentation Index
Fetch the complete documentation index at: https://mintlify.com/formbricks/formbricks/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Formbricks supports multiple authentication methods including email/password, OAuth providers, OpenID Connect (OIDC), and SAML SSO. This guide covers how to configure each authentication method for your self-hosted instance.Authentication Methods
Formbricks supports the following authentication methods:- Email/Password - Default authentication method
- GitHub OAuth - Sign in with GitHub
- Google OAuth - Sign in with Google
- Azure AD OAuth - Sign in with Microsoft Azure
- OpenID Connect (OIDC) - Generic OIDC provider support
- SAML SSO - Enterprise SAML single sign-on (requires Enterprise license)
Email/Password Authentication
Email/password authentication is enabled by default. You can control its behavior with these variables:Disable email/password authentication entirely.Options:
0- Email auth enabled (default)1- Email auth disabled (only OAuth/SSO available)
Disable email verification requirement for new signups.Note: Requires SMTP configuration if enabled.Options:
0- Email verification required1- Email verification disabled (default)
Disable password reset functionality.Note: Requires SMTP configuration if enabled.Options:
0- Password reset enabled1- Password reset disabled (default)
GitHub OAuth
Allow users to sign in with their GitHub accounts.Setup Instructions
- Go to GitHub Developer Settings
- Click “New OAuth App”
- Fill in the application details:
- Application name: Formbricks
- Homepage URL:
https://your-formbricks-domain.com - Authorization callback URL:
https://your-formbricks-domain.com/api/auth/callback/github
- Click “Register application”
- Generate a new client secret
- Add credentials to your
.envfile
Environment Variables
GitHub OAuth application client ID.
GitHub OAuth application client secret.
Example Configuration
Google OAuth
Allow users to sign in with their Google accounts.Setup Instructions
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to “APIs & Services” > “Credentials”
- Click “Create Credentials” > “OAuth client ID”
- Configure OAuth consent screen if prompted
- Select “Web application” as application type
- Add authorized redirect URI:
https://your-formbricks-domain.com/api/auth/callback/google
- Copy the client ID and client secret
Environment Variables
Google OAuth client ID.
Google OAuth client secret.
Example Configuration
Azure Active Directory OAuth
Allow users to sign in with their Microsoft/Azure AD accounts.Setup Instructions
- Go to Azure Portal
- Navigate to “Azure Active Directory” > “App registrations”
- Click “New registration”
- Fill in the details:
- Name: Formbricks
- Supported account types: Choose appropriate option
- Redirect URI: Web -
https://your-formbricks-domain.com/api/auth/callback/azure-ad
- Click “Register”
- Note the “Application (client) ID” and “Directory (tenant) ID”
- Go to “Certificates & secrets” and create a new client secret
Environment Variables
Azure AD application (client) ID.
Azure AD client secret value.
Azure AD directory (tenant) ID.
Example Configuration
OpenID Connect (OIDC)
Connect to any OIDC-compliant identity provider (Okta, Auth0, Keycloak, etc.).Environment Variables
OIDC client ID from your identity provider.
OIDC client secret from your identity provider.
OIDC issuer URL (discovery endpoint base URL).Examples:
- Okta:
https://your-domain.okta.com - Auth0:
https://your-tenant.auth0.com - Keycloak:
https://keycloak.example.com/realms/your-realm
Display name for the OIDC provider in the login UI.Example:
Sign in with OktaToken signing algorithm used by your OIDC provider.Default:
RS256Common values: RS256, HS256Example Configurations
Okta
Auth0
Keycloak
SAML SSO
Enterprise Feature: SAML SSO requires an Enterprise license. Set
ENTERPRISE_LICENSE_KEY to enable this feature.Environment Variables
Separate PostgreSQL database connection string for SAML configuration storage.SAML SSO uses BoxyHQ Jackson which requires a dedicated database.Example:
postgresql://postgres:postgres@localhost:5432/formbricks-samlEnterprise license key to unlock SAML SSO and other enterprise features.
Setup Instructions
-
Create a separate PostgreSQL database for SAML:
-
Configure environment variables:
- Restart Formbricks to initialize SAML database
-
Configure your SAML identity provider with:
- ACS URL:
https://your-formbricks-domain.com/api/auth/saml/callback - Entity ID:
https://saml.formbricks.com - Audience:
https://saml.formbricks.com
- ACS URL:
-
Upload your SAML metadata XML to the
./saml-connectiondirectory or configure via the Formbricks UI
Pre-loading SAML Connections
You can pre-configure SAML connections by placing metadata XML files in the./saml-connection directory before starting Formbricks.
Session Configuration
Maximum session age in seconds.Default:
86400 (24 hours)Example: 604800 (7 days)SSO Configuration
Auto-assign Users to Organization
Automatically assign new SSO users to a specific organization.Insert an existing organization ID or generate a valid CUID at getuniqueid.com.Example:
cjld2cjxh0000qzrmn831i7rnSkip invite requirement for SSO users.When enabled, SSO users can create accounts without requiring an invitation.Options:
0- Require invitation (default)1- Skip invitation requirement
Two-Factor Authentication (2FA)
Formbricks supports two-factor authentication via TOTP (Time-based One-Time Password). 2FA is available for:- Email/password authentication
- Can be enabled per-user in account settings
- Supports authenticator apps (Google Authenticator, Authy, etc.)
- Includes backup codes for account recovery
Security Considerations
Encryption Keys
Formbricks uses theENCRYPTION_KEY to encrypt sensitive data including:
- Two-factor authentication secrets
- Backup codes
- OAuth tokens
ENCRYPTION_KEY after initial setup, as it will make existing encrypted data unreadable.
Authentication Secrets
Rate Limiting
Formbricks includes built-in rate limiting for authentication endpoints to prevent brute force attacks:- Login attempts
- Password resets
- Email verification
- 2FA attempts
Audit Logging
Enable audit logging to track authentication events:Disabling Features
Disable organization invitations.Options:
0- Invites enabled (default)1- Invites disabled
Complete Authentication Example
Here’s an example.env configuration with multiple auth providers:
Troubleshooting
OAuth Redirect URI Mismatch
- Ensure the redirect URI in your OAuth provider matches exactly:
https://your-domain.com/api/auth/callback/{provider} - Check for trailing slashes - they must match
- Verify protocol (http vs https)
OIDC Discovery Issues
- Ensure
OIDC_ISSUERis correct and accessible - Check that
/.well-known/openid-configurationendpoint is reachable - Verify network/firewall rules allow outbound HTTPS
SAML Configuration
- Verify
SAML_DATABASE_URLpoints to a valid PostgreSQL database - Check that SAML metadata XML is valid
- Ensure ACS URL and Entity ID match between Formbricks and your IdP
Session Issues
- Verify
NEXTAUTH_SECRETis set and consistent across restarts - Check that
NEXTAUTH_URLmatches your actual domain - For custom base paths, include the full path in
NEXTAUTH_URL
Next Steps
- Email Configuration - Configure SMTP for password resets and verification
- Storage Configuration - Set up file storage
- Environment Variables Reference - Complete list of all variables