Setup Wizard
The Setup Wizard is the first step after installing Zuora Workflow Manager. It guides you through the initial configuration including creating the administrator account and configuring OAuth.Overview
What is the Setup Wizard?
The Setup Wizard is a guided process that:- Creates the first administrator account
- Configures general site settings
- Configures OAuth integration (optional)
- Generates roles and permissions (Filament Shield)
- Marks setup as completed
When does it activate?
The wizard is shown when:- First start: The application has just been installed
- Setup not completed: The table
setup_completedhascompleted=false
Access to Wizard
Simply navigate to root URL:The middleware
AuthenticateWithSetupBypass manages automatic redirect to the wizard.Wizard Steps
The wizard is divided into 3 main steps:Step 1: Welcome
Welcome Page
This page shows:- Welcome to Zuora Workflow Manager
- Explanation of what will be configured
- Overview of next steps
Contenuto
Step 2: OAuth Configuration
OAuth Configuration
In this step you can configure Google OAuth:| Field | Description | Required |
|---|---|---|
| OAuth Enabled | Enable/disable OAuth | No (default: false) |
| Allowed Domains | Allowed email domains | If OAuth enabled |
| Google Client ID | Google OAuth Client ID | If OAuth enabled |
| Google Client Secret | Google OAuth Client Secret | If OAuth enabled |
OAuth Enabled
Toggle to enable or disable OAuth:- true: Enables login with Google
- false: Only traditional login (email + password)
Allowed Domains
Enter the allowed email domains:Only users with email in these domains will be able to access via OAuth.
Google Client ID and Secret
Enter the OAuth credentials from Google Cloud Console:Step 3: Admin Account
Administrator Account Creation
In this step you create the first super_admin account:| Field | Description | Required | Validation |
|---|---|---|---|
| First Name | Administrator’s first name | Yes | Max 255 characters |
| Surname | Administrator’s last name | Yes | Max 255 characters |
| Admin Default Email | Administrator’s email | Yes | Valid email, unique |
| Admin Password | Account password | Yes | Minimum 8 characters |
Password Requirements
- Minimum length: 8 characters
- Recommended: Mix of letters, numbers, and special characters
- Revealable: You can reveal the password to verify
Setup Completion
Complete Setup Action
After filling all steps:- Click on Complete Setup at bottom of the wizard
- The wizard will execute the following operations
Completion Process
ThecompleteSetup() method executes the following operations in a transaction:
Database Transaction
All operations are wrapped in a transaction:Logs
The setup is logged for audit trail:Post-Setup
Application Access
After completion:- You will be automatically redirected to dashboard
- You will be logged in as the created admin user
- All functionalities will be available
Settings Access
As super_admin, you have access to Settings → General Settings:- Modify site name/description
- Enable/disable OAuth
- Add/remove allowed domains
- Configure admin email
- Enable maintenance mode
Roles Access
As super_admin, you can manage roles:- Navigate to Shield → Roles
- Create, modify, delete roles
- Assign granular permissions
Users Access
As super_admin, you can manage users:- Navigate to Users
- Create new users
- Modify existing users
- Assign roles
Troubleshooting
Wizard Not Appearing
Symptom: I navigate to URL but don’t see the wizard Possible causes:-
Setup already completed:
- Check table
setup_completed
- Check table
-
Middleware not loaded:
- Check that
AuthenticateWithSetupBypassis registered - Check Filament config
- Check that
-
Check setup completion status:
-
Check middleware:
Error During Completion
Symptom: Click “Complete Setup” but receive error Possible causes:-
User already exists:
- Email already present in database
- The wizard should update the user, not create a new one
-
Database connection error:
- Database not accessible
- Transaction failed
-
Shield generation error:
- Error during role generation
- Permissions not created correctly
-
Check user:
- If user exists, the wizard will update it
- If email different, new user will be created
-
Retry completion:
- Fix the error
- Refresh the page
- Repeat the wizard
-
Retry with corrected configuration:
- Verify credentials are correct
- Check database connection
- Retry the completion process
-
Verify user:
- If user exists, the wizard will update it
- If email different, a new user will be created
-
Retry completion:
- Correct the error
- Refresh the page
- Repeat the wizard
OAuth Not Working After Setup
Symptom: I configured OAuth in the wizard but it doesn’t work Possible causes:-
Incorrect credentials:
- Client ID or Secret incorrect
- Check on Google Cloud Console
-
Incorrect Redirect URI:
- Google Cloud Console → Credentials
- Check Authorized redirect URIs
- Must be:
{APP_URL}/oauth/google/callback
-
Allowed domains:
- User email not in allowed domains
- Add domain to Settings → OAuth Configuration
Best Practices
Initial Setup
1. Optional OAuth:- Configure OAuth in the wizard if you know the credentials
- Otherwise, configure later from Settings
- Don’t block setup for OAuth
Post-Setup
1. Creazione Utenti:- Non usare l’account admin per uso quotidiano
- Crea utenti con ruoli appropriati per lo staff
- Usa l’account admin solo per amministrazione
- Rivedi ruoli generati automaticamente
- Crea ruoli custom se necessario
- Documenta il purpose di ogni ruolo
- Verifica che tutte le settings siano corrette
- Testa OAuth login
- Verifica che admin email sia corretta
Security
1. Admin Account Protection:- MFA (if implemented in future)
- Regular password changes
- Limit accesses from specific IPs
- Monitor admin account login
- Set alerts for unusual logins
- Regularly check logs
- Backup database after setup
- Include users, roles, settings
- Test restore procedure
Code Reference
Setup.php
The wizard is defined inapp/Filament/Pages/Setup.php:
Middleware
The middlewareAuthenticateWithSetupBypass manages of redirect: