diff --git a/pages/registrieren.vue b/pages/registrieren.vue index 228bed5..c17bca9 100644 --- a/pages/registrieren.vue +++ b/pages/registrieren.vue @@ -745,24 +745,33 @@ const handleRegisterWithPasskey = async () => { // Prüfe, ob ein lokaler Authenticator verfügbar ist // Wenn ja, wird möglicherweise kein Cross-Device verwendet if (platformAuthAvailable) { - console.warn('[DEBUG] ⚠️ WARNUNG: Platform Authenticator ist verfügbar!') - console.warn('[DEBUG] Der Browser könnte einen lokalen Authenticator verwenden (Windows Hello, TouchID)') - console.warn('[DEBUG] statt Cross-Device. Prüfe, ob ein QR-Code erscheint oder ein lokaler Dialog.') + console.log('[DEBUG] ✅ Platform Authenticator ist verfügbar!') + console.log('[DEBUG] Der Browser wird wahrscheinlich einen lokalen Authenticator verwenden:') + console.log('[DEBUG] - Windows Hello (biometrisch oder PIN)') + console.log('[DEBUG] - TouchID auf Mac') + console.log('[DEBUG] - USB-Sicherheitsschlüssel') + console.log('[DEBUG] - Lokale Passkey-Speicherung im Browser') + console.log('[DEBUG] Das ist NORMAL und FUNKTIONIERT ohne Smartphone!') + console.log('[DEBUG] Cross-Device ist nur eine Option, nicht zwingend erforderlich.') + } else { + console.log('[DEBUG] ⚠️ Platform Authenticator ist NICHT verfügbar.') + console.log('[DEBUG] Der Browser könnte Cross-Device verwenden (Smartphone via QR-Code).') + console.log('[DEBUG] Oder einen USB-Sicherheitsschlüssel.') } // Versuche startRegistration aufzurufen - // Bei Cross-Device wird automatisch ein QR-Code generiert - // Der Browser sollte eine Verbindung zu Tunnel-Servern aufbauen (cable.ua5v.com, cable.auth.com) + // Mit authenticatorAttachment: 'platform' wird ein lokaler Authenticator verwendet: + // - Browser-eigene Passkey-Speicherung (Chrome Password Manager, Firefox Password Manager, etc.) + // - Windows Hello (biometrisch oder PIN) + // - TouchID auf Mac + // - KEIN Cross-Device (kein Smartphone nötig) console.log('[DEBUG] Calling startRegistration...') - console.log('[DEBUG] ⚠️ WICHTIG: Prüfe Browser Network-Tab während startRegistration läuft!') - console.log('[DEBUG] Erwartete Tunnel-Server-Requests:') - console.log('[DEBUG] - cable.ua5v.com (Google Chrome/Edge)') - console.log('[DEBUG] - cable.auth.com (Apple Safari)') - console.log('[DEBUG] - Andere Tunnel-Server (abhängig vom Browser)') - console.log('[DEBUG] Wenn KEINE Tunnel-Requests sichtbar sind:') - console.log('[DEBUG] → Cross-Device wird NICHT verwendet') - console.log('[DEBUG] → Möglicherweise wird ein lokaler Authenticator verwendet') - console.log('[DEBUG] → Oder der Browser unterstützt Cross-Device nicht') + console.log('[DEBUG] Konfiguriert für lokale Passkey-Speicherung im Browser') + console.log('[DEBUG] Erwartetes Verhalten:') + console.log('[DEBUG] - Browser zeigt Dialog für Passkey-Erstellung') + console.log('[DEBUG] - Passkey wird lokal im Browser gespeichert') + console.log('[DEBUG] - KEIN QR-Code (Cross-Device wird nicht verwendet)') + console.log('[DEBUG] - KEIN Smartphone nötig') credential = await mod.startRegistration({ optionsJSON: pre.options }) diff --git a/server/api/auth/register-passkey-options.post.js b/server/api/auth/register-passkey-options.post.js index 7d63437..5c3395d 100644 --- a/server/api/auth/register-passkey-options.post.js +++ b/server/api/auth/register-passkey-options.post.js @@ -102,11 +102,19 @@ export default defineEventHandler(async (event) => { authenticatorSelection: { residentKey: 'preferred', userVerification: 'preferred', - // WICHTIG: Für Cross-Device sollte requireResidentKey false sein - // und authenticatorAttachment nicht auf 'platform' beschränkt sein - // (sonst wird nur lokaler Authenticator verwendet) - requireResidentKey: false - // authenticatorAttachment nicht setzen = erlaubt sowohl platform als auch cross-platform + requireResidentKey: false, + // WICHTIG: authenticatorAttachment bestimmt, welche Authenticatoren verwendet werden können + // - 'platform': Nur lokale Authenticatoren (Windows Hello, TouchID, Browser-eigene Passkey-Speicherung) + // - 'cross-platform': Nur externe Authenticatoren (USB-Schlüssel, Smartphone via Cross-Device) + // - NICHT setzen: Browser entscheidet automatisch (kann lokale ODER Cross-Device verwenden) + // + // Für Browser-eigene Passkey-Speicherung: 'platform' verwenden + // Dies ermöglicht: + // - Browser-eigene Passkey-Speicherung (Chrome Password Manager, Firefox Password Manager, etc.) + // - Windows Hello (biometrisch oder PIN) + // - TouchID auf Mac + // - KEIN Cross-Device (kein Smartphone nötig) + authenticatorAttachment: 'platform' // Lokale Authenticatoren (Browser-eigene Passkey-Speicherung) }, // Timeout erhöhen für Cross-Device (Standard: 60s, hier: 5 Minuten) timeout: 300000