Go to file
Matt 0c9cd89667 Implement Official Keycloak JS Adapter with Proxy-Aware Configuration
MAJOR ENHANCEMENT: Complete Keycloak integration with proper HTTPS/proxy handling

## Core Improvements:

### 1. Enhanced Configuration (nuxt.config.ts)
- Added proxy trust configuration for nginx environments
- Configured baseUrl for production HTTPS enforcement
- Added debug mode configuration for development

### 2. Proxy-Aware Keycloak Composable (composables/useKeycloak.ts)
- Intelligent base URL detection (production vs development)
- Force HTTPS redirect URIs in production environments
- Enhanced debugging and logging capabilities
- Proper PKCE implementation for security
- Automatic token refresh mechanism

### 3. Dual Authentication System
- Updated middleware to support both Directus and Keycloak
- Enhanced useUnifiedAuth for seamless auth source switching
- Maintains backward compatibility with existing Directus users

### 4. OAuth Flow Implementation
- Created proper callback handler (pages/auth/callback.vue)
- Comprehensive error handling and user feedback
- Automatic redirect to dashboard on success

### 5. Enhanced Login Experience (pages/login.vue)
- Restored SSO login button with proper error handling
- Maintained existing Directus login form
- Clear separation between auth methods with visual divider

### 6. Comprehensive Testing Suite (pages/dashboard/keycloak-test.vue)
- Real-time configuration display
- Authentication status monitoring
- Interactive testing tools
- Detailed debug logging system

## Technical Solutions:

 **Proxy Detection**: Automatically detects nginx proxy and uses correct HTTPS URLs
 **HTTPS Enforcement**: Forces secure redirect URIs in production
 **Error Handling**: Comprehensive error catching with user-friendly messages
 **Debug Capabilities**: Enhanced logging for troubleshooting
 **Security**: Implements PKCE and secure token handling

## Infrastructure Compatibility:
- Works with nginx reverse proxy setups
- Compatible with Docker container networking
- Handles SSL termination at proxy level
- Supports both development and production environments

This implementation specifically addresses the HTTP/HTTPS redirect URI mismatch
that was causing 'unauthorized_client' errors in the proxy environment.
2025-06-14 15:26:26 +02:00
.gitea/workflows build: add workflow 2025-02-16 20:32:34 +02:00
components Update logo references and email logo URL in configuration 2025-06-13 13:36:14 +02:00
composables Implement Official Keycloak JS Adapter with Proxy-Aware Configuration 2025-06-14 15:26:26 +02:00
docs Implement Keycloak authentication integration and unify user management 2025-06-14 14:09:56 +02:00
middleware Implement Official Keycloak JS Adapter with Proxy-Aware Configuration 2025-06-14 15:26:26 +02:00
pages Implement Official Keycloak JS Adapter with Proxy-Aware Configuration 2025-06-14 15:26:26 +02:00
plugins feat: Implement comprehensive PWA functionality 2025-06-12 16:36:32 +02:00
public Feat: Complete EOI improvements and PWA implementation 2025-06-12 16:16:30 +02:00
server Implement Official Keycloak JS Adapter with Proxy-Aware Configuration 2025-06-14 15:26:26 +02:00
static feat: add files 2025-02-16 14:10:19 +02:00
utils fixes 2025-06-12 16:26:10 +02:00
.dockerignore feat: add files 2025-02-16 14:10:19 +02:00
.env.example Implement Keycloak authentication integration and unify user management 2025-06-14 14:09:56 +02:00
.gitignore feat: add files 2025-02-16 14:10:19 +02:00
Dockerfile REVERT Network Updates 2025-06-12 21:54:47 +02:00
README.md feat: add files 2025-02-16 14:10:19 +02:00
app.vue feat: add interest button 2025-06-03 22:04:22 +03:00
nuxt.config.ts Implement Official Keycloak JS Adapter with Proxy-Aware Configuration 2025-06-14 15:26:26 +02:00
package-lock.json MAJOR: Replace nuxt-openid-connect with official Keycloak JS adapter 2025-06-14 14:50:29 +02:00
package.json MAJOR: Replace nuxt-openid-connect with official Keycloak JS adapter 2025-06-14 14:50:29 +02:00
tsconfig.json feat: add files 2025-02-16 14:10:19 +02:00

README.md

Client Portal

Commands

  • npm run dev to start development

Tech Stack

  • Node.js
  • Nuxt
  • Directus
  • Vuetify