login-master¶
Federated identity with Supabase OAuth and zero-trust authentication
Login-master integrates with Supabase Auth to provide OAuth login (Google, GitHub, etc.), enabling users to access F3L1X without creating new passwords. It's the gateway between the public internet and your infrastructure.
What It Does¶
Login-master is your authentication layer:
- OAuth Integration - Google, GitHub, Microsoft identity providers
- Session Management - JWT tokens, refresh tokens, session expiry
- User Profiles - Store user metadata and preferences
- Team Management - Support for multiple team members with roles
- Access Control - Role-based and attribute-based access control (RBAC/ABAC)
Think of login-master as your bouncer—verifying identity and controlling who gets access to what.
Key Capabilities¶
Authentication Methods¶
- Google OAuth: Login with existing Google account
- GitHub OAuth: Developer-friendly authentication
- Microsoft Entra: Enterprise identity provider
- Email Link: Passwordless email authentication (backup)
- Magic Links: Time-limited secure login tokens
Session Management¶
- JWT Tokens: Secure, stateless authentication tokens
- Refresh Tokens: Extended sessions without re-login
- Session Expiry: Automatic logout after inactivity (configurable)
- Device Tracking: See which devices user is logged in on
- Logout All: Revoke all sessions with one action
User Profiles¶
- Profile Data: Name, email, avatar, preferences
- Custom Attributes: Store realm-specific user metadata
- Profile Picture: Synced from OAuth provider
- User Roles: Admin, developer, viewer, etc.
Team Management¶
- Team Creation: Users can create teams
- Invitations: Invite team members with email
- Role Assignment: Admin, editor, viewer roles per team
- Team Settings: Manage team configuration and billing
Accessing login-master¶
Login Page¶
URL: http://127.0.0.1:8043/login
The login page shows:
- Google OAuth button
- GitHub OAuth button
- Microsoft Entra button
- Email link option
- Sign up / forgot password links
Admin Dashboard¶
URL: http://127.0.0.1:8043/admin
The admin dashboard shows:
- User list and management
- Team management
- OAuth provider configuration
- Session monitoring
- Audit logs
API Endpoints¶
| Endpoint | Purpose | Method |
|---|---|---|
/api/auth/login/ |
Initiate OAuth flow | POST |
/api/auth/callback/ |
Handle OAuth callback | GET |
/api/auth/user/ |
Get current user profile | GET |
/api/auth/logout/ |
End session | POST |
/api/teams/ |
Manage teams | GET, POST |
Common Use Cases¶
Use Case 1: First-Time User Login¶
Goal: New user creates account via Google
- Navigate to login page
- Click "Sign in with Google"
- Google OAuth window opens
- User grants permission to share email/name
- Redirects back to F3L1X
- User profile created automatically
- Session established, can access dashboard
Use Case 2: Create Team for Collaboration¶
Goal: Set up team workspace for multiple users
- After login, click "Create Team"
- Enter team name and description
- Add team members by email
- Assign roles (admin, editor, viewer)
- Team members receive invitations
- Accept invitation to join team
- Team workspace ready for collaboration
Use Case 3: Revoke User Access¶
Goal: Remove user from team or system
- Go to team settings
- Find user in members list
- Click "Remove" next to username
- All sessions revoked immediately
- User redirected to login page
- Cannot re-access without re-invitation
Use Case 4: Switch Between Teams¶
Goal: User works on multiple teams
- Click team selector dropdown
- Select different team
- Seamless switch with same JWT token
- Dashboard updates to show team's realms
- Permissions updated based on team role
Important Notes¶
OAuth Providers Configuration¶
To use OAuth, you need to:
Google:
1. Go to Google Cloud Console
2. Create OAuth 2.0 credentials
3. Add callback URL: http://localhost:8043/api/auth/callback/google/
4. Get Client ID and Secret
5. Add to .env: GOOGLE_OAUTH_ID=... and GOOGLE_OAUTH_SECRET=...
GitHub:
1. Go to GitHub Settings > Developer Settings > OAuth Apps
2. Create new OAuth App
3. Authorization callback: http://localhost:8043/api/auth/callback/github/
4. Get Client ID and Secret
5. Add to .env: GITHUB_OAUTH_ID=... and GITHUB_OAUTH_SECRET=...
Session & Token Lifecycle¶
Default timing:
- JWT tokens valid for 1 hour
- Refresh tokens valid for 30 days
- Inactivity timeout: 24 hours
- Session cookies: Secure, HttpOnly, SameSite
Token refresh flow:
1. Token expires after 1 hour
2. Client automatically requests new token using refresh token
3. New JWT issued without user re-authentication
4. Refresh token refreshed (extends 30-day window)
5. Seamless background refresh
Security Best Practices¶
For end users:
- Never share your token
- Log out on shared devices
- Use strong passwords on OAuth providers
- Check "Device" page to revoke old sessions
For operators:
- Rotate OAuth secrets regularly (every 90 days)
- Monitor audit logs for suspicious activity
- Require HTTPS in production (enforced)
- Enable 2FA on admin accounts
RBAC (Role-Based Access Control)¶
Roles include:
| Role | Permissions | Use Case |
|---|---|---|
| Admin | All operations, manage users, settings | Team owner, developers |
| Editor | Create/modify realms and projects | Active developers |
| Viewer | Read-only access to realms | Stakeholders, observers |
| Guest | Limited feature access | Temporary users |
Troubleshooting¶
"Invalid OAuth credentials" error¶
Symptom: Login fails with OAuth provider error
Fix: Verify Client ID/Secret in .env, check callback URL matches OAuth provider config
Session expires too quickly¶
Symptom: User logged out after short time
Fix: Check token expiry settings in login-master config, may need to adjust timeout
User locked out of team¶
Symptom: User can't access team despite being member
Fix: Check user role permissions, may need to re-invite with correct role
OAuth callback hangs¶
Symptom: After clicking OAuth button, page doesn't respond
Fix: Check if Herald is running (login-master depends on it), verify network connectivity
Profile picture not showing¶
Symptom: Avatar field is blank despite OAuth provider having image
Fix: OAuth provider may not have granted permission to access picture, re-authorize with image permission
Related Realms¶
- herald - Login-master validates tokens through herald auth gateway
- f3l1x-dashboard - Users authenticate to access dashboard
- All realms - Can verify tokens from login-master