The Invitation Flow is not properly configured: - Only username is captured during invitations - Email field is missing (required for OIDC token generation) - 'Fehler fehlende Rechte' error indicates incomplete user data This guide walks through: 1. Diagnosing the current Invitation Flow configuration 2. Creating/repairing the Prompt Stage with email field 3. Adding the Prompt Stage to the Invitation Flow 4. Testing the complete enrollment process Related to: User Boje enrollment failure via invitation link Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
6.3 KiB
🔧 Authentik Invitation Flow Fix – Für Einladungslinks
Problem:
- Standard Enrollment (akadmin): ✅ funktioniert
- Invitation Flow (Boje über Einladungslink): ❌ Nur Username gefragt, keine Email
- Nach Enrollment: "Fehler fehlende Rechte"
Root Cause: Invitation Flow erfasst nicht alle erforderlichen Felder (Email) für OIDC-Token-Generation.
Phase 1: Diagnose im Authentik Admin UI
# Authentik Admin UI öffnen
kubectl port-forward -n authentik svc/authentik 9000:9000
# Browser: http://localhost:9000/
# Admin credentials: akadmin / (password)
1.1 Überprüfe: Welche Flows existieren?
Navigation: Admin → Flows & Stages → Flows
Suche nach diesen Flows:
enrollment– Standard Enrollment (für akadmin)invitation– Invitation Flow (für Einladungslinks)default-authentication-flow– Standard Login
1.2 Überprüfe: Standard Enrollment Flow (funktioniert)
Navigation: Flows → enrollment öffnen
Stages sollten sein:
1. Identify (if not exists)
└─ Binding: "Identification (if not exists)"
2. Write
└─ Binding: "Create or update user"
└─ Field bindings MUST include:
├─ username
├─ email ← WICHTIG
└─ name (optional)
3. (optional) Weitere Stages
4. Finish
Wichtig: Alle Felder müssen "required" sein (nicht optional).
1.3 Überprüfe: Invitation Flow (wahrscheinlich kaputt)
Navigation: Flows → invitation öffnen
Problem: Wahrscheinlich fehlt die "Email" Stage hier!
Sollte sein:
1. Invite Stage
└─ Binding: "Invite user"
2. Identification (if not exists)
└─ Binding: "Identify"
3. Prompt Stage (für zusätzliche Daten!)
└─ Binding: "Prompt for data"
└─ Fields: username, email, name, password
4. Write
└─ Binding: "Create or update user"
5. Finish
Phase 2: Reparatur der Invitation Flow
Schritt 1: Neue "Prompt Stage" erstellen (falls nicht existiert)
Navigation: Admin → Flows & Stages → Stages
-
Klick "Create"
-
Name:
invitation-promptoder ähnlich -
Type: "Prompt Stage"
-
Configure:
- Fields to Prompt:
- Username (required)
- Email (required) ← WICHTIG
- Name (optional)
- Password (optional, da OIDC)
- Fields to Prompt:
-
Save
Schritt 2: Invitation Flow reparieren
Navigation: Admin → Flows & Stages → Flows → invitation
Stages in dieser Reihenfolge:
Stage 1: Invite Stage
├─ Binding: "Invite"
├─ Required: Yes
Stage 2: Identification Stage
├─ Binding: "Identify" (oder "Identification (if not exists)")
├─ Required: No
Stage 3: [NEUE STAGE] Prompt für Email/Username
├─ Type: "Prompt Stage"
├─ Binding: "Prompt for data"
├─ Fields:
│ ├─ username (required)
│ ├─ email (required) ← ENTSCHEIDEND
│ └─ name (optional)
├─ Required: Yes
Stage 4: Write
├─ Binding: "Create or update user"
├─ User Creation Policies: (standard)
├─ Required: Yes
Stage 5: Finish
├─ Binding: "Finish"
├─ Required: Yes
Speichern und Testen!
Phase 3: Teste Invitation Flow
Test 1: Neuen Einladungslink erstellen
Navigation: Admin → Users & Groups → Invitations
- Klick "Create"
- Expiry: 7 days
- Create & Copy Link
Test 2: Einladungslink öffnen (in neuem Browser/Inkognito)
-
Link öffnen
-
Enrollment Flow sollte jetzt:
- Username eingeben
- Email eingeben ← Das sollte jetzt da sein!
- Name eingeben (optional)
- "Sign in with Authentik" klicken (falls Authentik-Binding korrekt)
-
Nach Authentik-Login: User in Synapse erstellt?
kubectl exec -it -n matrix matrix-stack-postgres-0 -- \ psql -U synapse -d synapse -c "SELECT name FROM users WHERE created_ts > now() - interval '5 minutes';"
Test 3: Prüfe MAS Logs auf Fehler
kubectl logs -f matrix-stack-matrix-authentication-service-6b994b9fcf-qqcxz -n matrix | grep -i "error\|fail\|boje"
Phase 4: Häufige Fehler & Lösungen
Fehler 1: "Fehlende Rechte" nach Enrollment
Symptom: Enrollment abgeschlossen, aber Fehler auf Berechtigungsseite
Ursachen:
- Email-Feld wurde nicht erfasst
- OIDC-Token hat unvollständige Daten
- Synapse User konnte nicht erstellt werden (Duplikat?)
Lösung:
- Authentik Logs prüfen:
kubectl logs -n authentik -l app.kubernetes.io/name=authentik -f | grep -i "error\|invitation" - MAS Logs prüfen:
kubectl logs -f matrix-stack-matrix-authentication-service-6b994b9fcf-qqcxz -n matrix | grep -i "boje\|error" - Synapse Logs prüfen:
kubectl logs -f -n matrix matrix-stack-synapse-0 | grep -i "boje\|register"
Fehler 2: "Stage not found" oder "Flow invalid"
Ursache: Invitation Flow hat Binding-Fehler
Lösung:
- Admin UI → Flows → Invitation Flow öffnen
- Alle Stages überprüfen, dass sie korrekt gebunden sind
- Keine leeren/ungültigen Bindings
- Save & Retry
Fehler 3: Email-Feld wird nicht angezeigt
Ursache: Prompt Stage hat email nicht in Fields
Lösung:
- Admin UI → Flows → Stages → Prompt Stage öffnen
- Edit → Fields überprüfen
- Email hinzufügen if missing:
- Field name:
email - Type:
email - Required: Yes
- Field name:
- Save
Erwarteter Ablauf nach Fix
- Browser öffnet Einladungslink → Enrollment Flow
- "Username eingeben" → z.B. "boje"
- "Email eingeben" ← Sollte jetzt da sein
- "Name eingeben" (optional)
- "Weiter" oder "Mit Authentik anmelden"
- Authentik Login
- Enrollment abgeschlossen
- User "boje" in Synapse DB angelegt
- Login zu ElementWeb möglich
Checkliste
- Authentik Admin UI geöffnet (port-forward 9000)
- Standard Enrollment Flow überprüft (funktioniert mit akadmin)
- Invitation Flow überprüft
- Prompt Stage existiert mit email field
- Invitation Flow hat alle 5 Stages in korrekter Reihenfolge
- Neuen Einladungslink erstellt und getestet
- Test-User hat Email eingeben können
- Test-User in Synapse DB nach Login
- MAS Logs zeigen keine Fehler
Frage: Stimmt das mit deiner Beobachtung überein - dass bei der Einladung nur Username gefragt wurde, aber nicht die Email?
Wenn ja, dann ist der Fix:
- Prompt Stage erstellen/reparieren (mit email field)
- Zur Invitation Flow hinzufügen
- Testen
Soll ich dir noch mehr Detailschritte geben?