| title | Authentication Methods |
|---|---|
| description | Available authentication methods in DeployStack, including email registration and GitHub OAuth, with configuration instructions for administrators. |
DeployStack supports multiple authentication methods to provide flexibility for different user preferences and organizational requirements. This document outlines the available authentication options and how to configure them.
Email-based authentication is the primary authentication method in DeployStack. Users can register with their email address and password, and subsequently log in using these credentials.
Features:
- Secure password hashing using Argon2
- Email verification (when email sending is enabled)
- Password reset functionality
- Profile management
User Experience:
- Users register with email, password, and optional personal information
- Email verification may be required (depending on configuration)
- Users can log in using email or username
- Password reset available via email (when email sending is enabled)
GitHub OAuth provides a convenient way for users to authenticate using their existing GitHub accounts. This method is particularly useful for development teams and organizations already using GitHub.
Features:
- Single sign-on with GitHub
- Automatic email verification (GitHub emails are considered verified)
- Profile information imported from GitHub
- Secure OAuth 2.0 flow
User Experience:
- Users click "Login with GitHub" button
- Redirected to GitHub for authorization
- Upon approval, automatically logged into DeployStack
- Profile information (name, email) imported from GitHub
Administrators can control authentication behavior through global settings:
| Setting | Description | Default |
|---|---|---|
| Enable Login | Master switch for all authentication methods | true |
| Enable Email Registration | Allow new users to register via email | true |
| GitHub OAuth Enabled | Enable GitHub OAuth authentication | false |
Email authentication is always available but requires SMTP configuration for full functionality:
Required for Full Functionality:
- SMTP server configuration (for email verification and password reset)
- Email sending enabled in global settings
Configuration Steps:
- Navigate to Global Settings → SMTP Mail Settings
- Configure SMTP server details:
- Host (e.g.,
smtp.gmail.com) - Port (e.g.,
587) - Username and Password
- Security settings
- Host (e.g.,
- Enable email sending in Global Settings → Global Configuration
GitHub OAuth requires setup both in GitHub and DeployStack:
GitHub Setup:
- Go to GitHub → Settings → Developer settings → OAuth Apps
- Create a new OAuth App with:
- Application name: Your DeployStack instance name
- Homepage URL: Your DeployStack frontend URL
- Authorization callback URL:
https://your-domain.com/api/auth/github/callback
- Note the Client ID and Client Secret
DeployStack Configuration:
- Navigate to Global Settings → GitHub OAuth Configuration
- Configure the following settings:
- Client ID: From your GitHub OAuth App
- Client Secret: From your GitHub OAuth App (encrypted)
- Enabled: Set to
trueto activate GitHub OAuth - Callback URL: Must match the URL configured in GitHub
- Scope: OAuth permissions (default:
user:email)
Configuration Example:
Client ID: abc123def456
Client Secret: [encrypted]
Enabled: true
Callback URL: https://your-deploystack.com/api/auth/github/callback
Scope: user:email
The first user registered in DeployStack automatically becomes the Global Administrator with full system access. This ensures there's always at least one administrator who can manage the system.
Important Notes:
- The first user must be created via email registration
- GitHub OAuth cannot be used to create the first user
- This prevents accidental creation of admin accounts via OAuth
All users registered after the first user receive the Global User role by default, regardless of authentication method used.
Role Assignment:
- Email Registration:
global_userrole - GitHub OAuth:
global_userrole - Role Changes: Only global administrators can modify user roles
- Passwords are hashed using Argon2 with secure parameters
- Email verification prevents unauthorized account creation
- Password reset tokens are time-limited and single-use
- Session management handled by Lucia v3
- OAuth 2.0 standard with state parameter for CSRF protection
- GitHub emails are considered verified
- Secure token exchange and validation
- No GitHub credentials stored in DeployStack
When a user with an existing email account uses GitHub OAuth with the same email address:
- The GitHub account is automatically linked to the existing account
- User can subsequently use either authentication method
- No duplicate accounts are created
Email verification not working:
- Check SMTP configuration in Global Settings
- Verify email sending is enabled
- Check server logs for email delivery errors
Password reset not working:
- Ensure SMTP is configured and email sending is enabled
- Verify the reset link hasn't expired (tokens are time-limited)
"GitHub OAuth is not enabled" error:
- Check that GitHub OAuth is enabled in Global Settings
- Verify Client ID and Client Secret are configured
- Ensure callback URL matches GitHub OAuth App configuration
"GitHub email not available" error:
- User's GitHub email must be public and verified
- Check GitHub account email settings
- Ensure OAuth scope includes
user:email
First user creation blocked:
- This is expected behavior - first user must use email registration
- Use email registration to create the initial administrator account
Login disabled:
- Check that "Enable Login" is set to
truein Global Settings - Verify database is properly configured and accessible
Registration disabled:
- Check that "Enable Email Registration" is set to
truefor email signup - Verify GitHub OAuth is enabled and configured for GitHub login
For developers and integrations, DeployStack provides REST API endpoints for authentication:
POST /api/auth/email/register- User registrationPOST /api/auth/email/login- User loginPOST /api/auth/email/forgot-password- Password reset requestPOST /api/auth/email/reset-password- Password reset confirmation
GET /api/auth/github/login- Initiate GitHub OAuth flowGET /api/auth/github/callback- OAuth callback handlerGET /api/auth/github/status- Check if GitHub OAuth is enabled
POST /api/auth/logout- User logoutGET /api/users/me- Get current user profilePUT /api/auth/profile/update- Update user profile
- Always configure the first user via email to ensure proper admin access
- Set up SMTP early to enable email verification and password reset
- Use strong OAuth secrets and keep them secure
- Regularly review user accounts and roles
- Monitor authentication logs for security issues
- Use strong passwords for email authentication
- Verify your email address when using email registration
- Keep GitHub account secure when using OAuth
- Use the same email address across authentication methods for account linking
- Choose authentication methods that align with your security policies
- Consider GitHub OAuth for development teams already using GitHub
- Implement proper access controls through user roles
- Document authentication procedures for your team
- Plan for account recovery scenarios
For technical implementation details, see the Backend Authentication Documentation and Global Settings Management.