Authentication Overview
Flowise supports multiple authentication mechanisms:- Username/Password Authentication - Local user accounts with JWT tokens
- Email Verification - Password reset and account verification via email
- Session Management - Secure session handling with Express sessions
- JWT Tokens - Access and refresh tokens for API authentication
Basic Authentication Setup
To enable authentication, configure the following environment variables:Required Configuration
Generate secure secrets
Generate cryptographically secure secrets for JWT and sessions:Add to your
.env file:.env
Secret Key Management
Flowise supports three methods for storing authentication secrets:- Environment Variables (Simple)
- File Storage (Default)
- AWS Secrets Manager (Recommended)
Set secrets directly in environment variables:Pros: Simple, works everywhereCons: Secrets stored in plain text
.env
How Flowise Handles Secrets
Flowise uses a priority system for authentication secrets:- Check environment variables - If set (and not a weak default), use them
- Check AWS Secrets Manager - If
SECRETKEY_STORAGE_TYPE=aws, retrieve from AWS - Check local files - Look for secret key files in
SECRETKEY_PATH - Generate new secrets - If none exist, generate random 32-byte secrets
Flowise automatically detects weak default values and treats them as “not set”, forcing use of file/AWS storage instead.
Token Configuration
Access & Refresh Tokens
Expiry time for access tokens (default: 6 hours).
.env
Expiry time for refresh tokens (default: 30 days).
.env
Force all tokens to expire when the application restarts.
.env
Token Security
Flowise implements several security measures:- Token rotation - Refresh tokens can be rotated on use
- Token hashing - Tokens are hashed before storage using
TOKEN_HASH_SECRET - Token revocation - Tokens can be invalidated on logout or security events
- Secure cookies - Tokens stored in HTTP-only cookies when
SECURE_COOKIES=true
Email Configuration
Email is required for password reset and user invitations.SMTP Setup
Popular SMTP Providers
- Gmail
- SendGrid
- AWS SES
- Mailgun
.env
For Gmail, you need to create an App Password instead of using your regular password.
Email Security
Allow self-signed SSL certificates (for testing only).
.env
Password Security
Password Hashing
Number of bcrypt salt rounds for password hashing. Higher values are more secure but slower.
.env
Password Reset
Expiry time for password reset tokens.
.env
Cookie Security
Enable secure cookies (HTTPS only). Required for production with HTTPS.
.env
CORS Configuration
Control which origins can access your Flowise API.Comma-separated list of allowed origins.
.env
Comma-separated list of allowed iframe origins.
.env
Proxy & Trust Settings
Trust proxy headers for IP detection. Required when behind load balancers.Options:
true, false, 1, loopback, linklocal, uniquelocal, or IP addresses.env
Number of proxies between user and Flowise.
.env
HTTP Security
Security Checks
Enable HTTP security checks for outbound requests.
.env
Comma-separated list of blocked HTTP hosts.
.env
Custom MCP Security
Enable security checks for custom MCP protocols.
.env
Custom MCP protocol type. Options:
stdio or sse..env
User Management
Creating the First Admin User
When you first access Flowise with authentication enabled, you’ll be prompted to create an admin account:- Navigate to your Flowise URL
- Click “Sign Up” or you’ll be redirected to registration
- Enter admin credentials
- Verify email if configured
User Roles
Flowise supports role-based access control:- Admin - Full access to all features and settings
- User - Access to create and manage workflows
- Viewer - Read-only access
User role management is available in Flowise Enterprise Edition.
Workspace Management (Enterprise)
Workspace Invitations
Expiry time for workspace invitation tokens.
.env
Path to custom workspace invitation email template.
.env
Production Security Checklist
Before deploying to production:- Authentication
- Network Security
- Database
- Application
- Generate strong, unique secrets using
openssl rand -hex 32 - Set
APP_URLto your production URL - Configure SMTP for password reset
- Enable
SECURE_COOKIES=truefor HTTPS - Set appropriate token expiry times
- Consider using AWS Secrets Manager for secret storage
- Never commit secrets to version control
Example Production Configuration
Here’s a complete example for a secure production deployment:.env
Troubleshooting
Common Issues
Authentication not working
Authentication not working
- Verify
APP_URLis set correctly - Check that secrets are properly configured
- Ensure database is accessible
- Check logs for authentication errors
- Verify CORS settings if accessing from different origin
Password reset emails not sending
Password reset emails not sending
- Verify SMTP configuration is correct
- Test SMTP credentials separately
- Check spam folder
- Verify sender email is authenticated
- Check firewall allows outbound SMTP connections
Tokens expiring too quickly
Tokens expiring too quickly
- Check
JWT_TOKEN_EXPIRY_IN_MINUTESsetting - Verify system clock is accurate
- Check if
EXPIRE_AUTH_TOKENS_ON_RESTART=true - Look for token revocation in logs
CORS errors
CORS errors
- Set
CORS_ORIGINSto include your frontend URL - Ensure protocol (http/https) matches exactly
- Check for trailing slashes in URLs
- Verify
TRUST_PROXYis set correctly
Next Steps
Environment Variables
Complete environment variable reference
Docker Deployment
Deploy Flowise with Docker
Cloud Providers
Deploy to cloud platforms
