Authentication Methods
JWT Authentication
Flowise uses JSON Web Tokens (JWT) for modern authentication with access and refresh token support.Configure JWT Secrets
Generate secure random secrets for JWT tokens:.env file:
If you don’t set
JWT_AUTH_TOKEN_SECRET and JWT_REFRESH_TOKEN_SECRET, Flowise will automatically generate and store them securely in the filesystem or AWS Secrets Manager.JWT Token Configuration
Secret key for signing access tokens. Auto-generated if not provided.
Secret key for signing refresh tokens. Auto-generated if not provided.
Token issuer claim (iss)
Token audience claim (aud)
Access token lifetime in minutes (default: 6 hours)
Refresh token lifetime in minutes (default: 30 days)
Basic HTTP Authentication
Set username and password for basic HTTP authentication:Username for basic HTTP authentication
Password for basic HTTP authentication
Session Management
Express Session Configuration
Secret for Express session cookie signing. Auto-generated if not provided.
Enable secure flag on cookies. Set to
true for HTTPS deployments.Token Management
Secret for hashing authentication tokens. Auto-generated if not provided.
Force all users to re-authenticate when the application restarts
User Management
Password Configuration
Number of bcrypt salt rounds for password hashing. Higher values are more secure but slower.
10: Default (recommended for most use cases)12: Higher security14: Maximum security (slower)
Invitation & Password Reset
Workspace invitation token validity period in hours
Password reset token validity period in minutes
Secret Storage
Flowise supports multiple storage backends for authentication secrets:Local File Storage (Default)
Secrets are stored in encrypted files on the local filesystem:Storage backend for secrets. Options:
local, awsLocal directory for storing secret keys when using
local storageAWS Secrets Manager
For production deployments, use AWS Secrets Manager:AWS access key ID with permissions for Secrets Manager
AWS secret access key
AWS region where secrets are stored
Name of the main encryption key secret in AWS Secrets Manager
Prefix for auth-related secret names (e.g.,
FlowiseTokenHashSecret)When using AWS Secrets Manager, the following secrets are automatically created:
{PREFIX}TokenHashSecret{PREFIX}ExpressSessionSecret{PREFIX}JWTAuthTokenSecret{PREFIX}JWTRefreshTokenSecret{PREFIX}JWTIssuer{PREFIX}JWTAudience
Required IAM Permissions
If using AWS Secrets Manager, ensure your IAM user/role has these permissions:Enterprise SSO (Enterprise Edition)
SSO features require Flowise Enterprise Edition.
- Google OAuth 2.0
- Microsoft Azure AD
- Auth0
- GitHub
Email Configuration for Auth
Configure SMTP for sending authentication emails (verification, password reset, invitations):SMTP server hostname
SMTP server port (465 for SSL, 587 for TLS)
SMTP authentication username
SMTP authentication password
Use TLS/SSL for SMTP connection
From address for all authentication emails
Custom Email Templates
Path to custom Handlebars template for workspace invitation emails
Security Best Practices
1. Use Strong Secrets
Always generate cryptographically secure random values:2. Enable HTTPS
For production, always use HTTPS and enable secure cookies:3. Configure Token Expiry
Set appropriate token expiration based on your security requirements:4. Use AWS Secrets Manager in Production
For production deployments, store secrets in AWS Secrets Manager:5. Rotate Secrets Regularly
Implement a secret rotation policy:- Generate new secrets
- Update environment variables
- Restart Flowise
- Optionally expire existing tokens with
EXPIRE_AUTH_TOKENS_ON_RESTART=true
Testing Authentication
Verify Basic Auth
Get JWT Token
Use JWT Token
Troubleshooting
Invalid or Expired Token
Problem: Users get logged out unexpectedly Solutions:- Check
JWT_TOKEN_EXPIRY_IN_MINUTESis appropriate - Ensure system clocks are synchronized (JWT uses timestamps)
- Verify
JWT_AUTH_TOKEN_SECREThasn’t changed
SMTP Connection Failed
Problem: Email invitations not sending Solutions:- Verify SMTP credentials are correct
- Check firewall allows outbound connections on SMTP port
- For Gmail, use App Passwords instead of account password
- Test SMTP settings:
AWS Secrets Manager Access Denied
Problem: Cannot read/write secrets in AWS Solutions:- Verify IAM permissions (see Required IAM Permissions above)
- Check AWS credentials are valid
- Ensure region is correct
- Verify secret names match the prefix pattern