Skip to content

Latest commit

 

History

History
157 lines (129 loc) · 4.58 KB

File metadata and controls

157 lines (129 loc) · 4.58 KB

Keycloak Fix Checklist

Pre-Flight Check

  • All Spring Boot services stopped in IntelliJ
  • Browser closed (or at least all localhost tabs)
  • PowerShell open in project directory

Step-by-Step Checklist

1. Clear Browser Storage

2. Reset Keycloak

  • Run: .\FORCE_CLEAN_KEYCLOAK_H2.ps1
  • Type DELETE when prompted
  • Wait for "Keycloak is UP and running!" message
  • See new Keycloak console window open

3. Create Keycloak Admin

  • Open http://localhost:9090
  • See "Welcome to Keycloak" page
  • Enter username: admin
  • Enter password: admin
  • Click "Create"
  • See "User created" message
  • Click "Administration Console"
  • Login with admin/admin
  • See Keycloak admin dashboard

4. Configure Keycloak

  • Run: .\AUTO_CONFIGURE_KEYCLOAK.ps1
  • See "Connexion a Keycloak... OK"
  • See "Realm cree" or "Realm existe deja"
  • See "Role TEACHER cree"
  • See "Role STUDENT cree"
  • See "Role ADMIN cree"
  • See "Client cree"
  • See "CONFIGURATION TERMINEE!"

5. Start Services

  • Open IntelliJ
  • Start EurekaServer (port 8761)
  • Wait for "Started EurekaServerApplication"
  • Start ApiGateway (port 8888)
  • Wait for "Started ApiGatewayApplication"
  • Start UserService (port 8085)
  • Wait for "Started UserApplication"
  • Start AbonnementService (port 8084)
  • Wait for "Started AbonnementApplication"

6. Create Admin Account

7. Test Login

  • Open browser
  • Go to http://localhost:4200
  • Click "Sign In" button
  • Enter email: admin@wordly.com
  • Enter password: Admin123!
  • Click "Sign In"
  • See "Signing in..." message
  • Wait for redirect
  • Should redirect to http://localhost:4201/dashboard
  • See dashboard with admin menu

Verification Checklist

Services Running

Keycloak Configuration

  • Realm wordly-realm exists
  • Client wordly-client exists
  • Client secret is v9BVegPOBMnWfQHJHdswfY0EQXUIFSyy
  • Roles exist: TEACHER, STUDENT, ADMIN
  • User admin exists in Keycloak

Database

  • MySQL running on port 3307 (XAMPP)
  • Database user_db exists
  • Database abonnement_db exists
  • Keycloak using H2 (no external database)

Admin Account

  • Admin user exists in MySQL user_db.users table
  • Admin user exists in Keycloak
  • Can login with admin@wordly.com / Admin123!
  • Login redirects to dashboard
  • Dashboard shows admin menu

Troubleshooting

If Keycloak won't start:

  • Kill all Java processes: Get-Process java | Stop-Process -Force
  • Delete data: Remove-Item C:\keycloak-23.0.0\data -Recurse -Force
  • Run FORCE_CLEAN_KEYCLOAK_H2.ps1 again

If AUTO_CONFIGURE fails:

  • Check Keycloak is running (http://localhost:9090)
  • Check you created admin/admin user in Keycloak
  • Try running the script again

If CREATE_ADMIN_ACCOUNT fails:

  • Check UserService is running in IntelliJ
  • Check API Gateway is running
  • Check Keycloak is running
  • Check UserService logs for errors
  • Try running the script again

If login fails:

  • Clear browser localStorage again
  • Check all services are running
  • Check you're using admin@wordly.com (not admin)
  • Check password is Admin123! (case sensitive)
  • Check browser console for errors (F12)

Success Criteria

✅ All checkboxes above are checked ✅ Can login as admin and see dashboard ✅ No errors in browser console ✅ No errors in IntelliJ console ✅ All services registered in Eureka


Time Estimate

  • Steps 1-4: ~5 minutes
  • Step 5: ~2 minutes
  • Steps 6-7: ~1 minute
  • Total: ~8 minutes