- Go to Google Cloud Console
- Create a new project or select existing one
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth 2.0 Client ID
- Configure OAuth consent screen if prompted
- Application type: Web application
- Add authorized redirect URIs:
https://arxsyeioxxjrukonnzwm.supabase.co/auth/v1/callback http://localhost:3002/auth/callback - Copy Client ID and Client Secret
- Go to Supabase Dashboard
- Select your project: arxsyeioxxjrukonnzwm
- Go to Authentication > Providers
- Find Google and toggle it ON
- Paste your Google Client ID and Client Secret
- Click Save
- Go to Azure Portal
- Navigate to Azure Active Directory > App registrations
- Click New registration
- Name: Campus Resource Engine
- Supported account types: Accounts in any organizational directory and personal Microsoft accounts
- Redirect URI: Web +
https://arxsyeioxxjrukonnzwm.supabase.co/auth/v1/callback - Click Register
- Copy Application (client) ID
- Go to Certificates & secrets
- Click New client secret
- Copy the Value (this is your Client Secret)
- Go to Supabase Dashboard
- Select your project: arxsyeioxxjrukonnzwm
- Go to Authentication > Providers
- Find Azure (Microsoft) and toggle it ON
- Paste your Azure Client ID and Client Secret
- Azure Tenant: Use
commonfor multi-tenant support - Click Save
Your Supabase URL and keys are already set in .env:
SUPABASE_URL=https://arxsyeioxxjrukonnzwm.supabase.co
SUPABASE_SERVICE_KEY=...
After configuring in Supabase:
- The OAuth buttons will appear on your login page
- Click "Continue with Google" or "Continue with Microsoft"
- Complete the OAuth flow
- User will be created automatically in Supabase Auth
- Production URLs: When deploying, add your production domain to authorized redirect URIs
- Email Verification: OAuth users are automatically verified
- User Sync: After OAuth login, create a record in
public.userstable to sync roles - Default Role: OAuth users should be assigned a default role (e.g., STUDENT)
Run the updated LoginForm and test OAuth login!