refactor(mail): send via the SSO app registration, drop SMTP basic auth
Docker Image bauen und veroeffentlichen / build-and-push (push) Successful in 2m25s
Docker Image bauen und veroeffentlichen / build-and-push (push) Successful in 2m25s
Mail now uses the same Entra ID app registration as "Sign in with Microsoft" (ENTRA_TENANT_ID, ENTRA_CLIENT_ID, ENTRA_CLIENT_SECRET), so only one enterprise application is needed. The app additionally gets the SMTP.SendAsApp permission; Exchange still limits it to the mailbox granted via Add-MailboxPermission. Password (basic auth) sending is removed entirely: SMTP_HOST, SMTP_PORT, SMTP_PASSWORD and the separate SMTP_OAUTH_* settings are gone. The transport is fixed to smtp.office365.com:587 with required STARTTLS. SMTP_USER (sending mailbox) and SMTP_FROM remain. - lib/entra.ts exposes readEntraAppCredentials(), shared by SSO and mail - diagnosis drops basic-auth-only causes; hints name the ENTRA_* values and warn that an expired secret breaks sign-in and mail together - admin e-mail test, .env.example, docker-compose, k8s manifests, preflight and README updated Verified against Entra ID with fake values: token error classified, client secret never exposed, missing ENTRA_CLIENT_SECRET reported. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
0620e9d79a
commit
11910dd6dd
15 files changed
+211
-309
No files matched your search
+12
-20
@@ -68,27 +68,15 @@ stringData:
|
||||
# https://wabenhain.com/api/checkout/webhook zeigt (whsec_...).
|
||||
STRIPE_WEBHOOK_SECRET: "CHANGE-ME"
|
||||
|
||||
# Ohne SMTP werden E-Mails nur ins Server-Log geschrieben (src/lib/mail.ts):
|
||||
# keine Bestellbestaetigung, keine Versandmeldung, keine
|
||||
# Passwort-Zuruecksetzung. Funktioniert mit jedem SMTP-Anbieter; Port und
|
||||
# Absenderadresse stehen als SMTP_PORT/SMTP_FROM in 01-configmap.yaml.
|
||||
#
|
||||
# SMTP_USER ist immer das Postfach, mit dem gesendet wird (z. B.
|
||||
# [email protected]) — und sollte dieselbe Adresse wie SMTP_FROM sein.
|
||||
#
|
||||
# Microsoft 365 mit OAuth 2.0 (empfohlen): SMTP_OAUTH_CLIENT_SECRET setzen,
|
||||
# dazu SMTP_OAUTH_TENANT_ID/SMTP_OAUTH_CLIENT_ID in 01-configmap.yaml.
|
||||
# SMTP_HOST darf leer bleiben (Standard smtp.office365.com), SMTP_PASSWORD
|
||||
# wird nicht gebraucht. Das Secret laeuft ab (hoechstens 24 Monate) —
|
||||
# Ablaufdatum im Kalender eintragen.
|
||||
#
|
||||
# Andere Anbieter: SMTP_HOST und SMTP_PASSWORD setzen,
|
||||
# SMTP_OAUTH_CLIENT_SECRET leer lassen.
|
||||
SMTP_HOST: "CHANGE-ME"
|
||||
# Mailversand ueber Microsoft 365 mit OAuth 2.0 (src/lib/mail.ts) — mit der
|
||||
# App-Registrierung der Entra-ID-SSO unten (ENTRA_TENANT_ID,
|
||||
# ENTRA_CLIENT_ID, ENTRA_CLIENT_SECRET), kein Passwort. Ohne diese Werte
|
||||
# und SMTP_USER werden E-Mails nur ins Server-Log geschrieben: keine
|
||||
# Bestellbestaetigung, keine Versandmeldung, keine Passwort-Zuruecksetzung.
|
||||
# SMTP_USER ist das Postfach, mit dem gesendet wird (z. B.
|
||||
# [email protected]) — dieselbe Adresse wie SMTP_FROM in
|
||||
# 01-configmap.yaml. Einrichtung: README "E-Mail-Versand".
|
||||
SMTP_USER: "CHANGE-ME"
|
||||
SMTP_PASSWORD: "CHANGE-ME"
|
||||
# "Wert" (nicht "Geheimnis-ID") des geheimen Clientschluessels der App
|
||||
SMTP_OAUTH_CLIENT_SECRET: ""
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# EMPFOHLEN — der Shop laeuft auch ohne, aber ungeschuetzt
|
||||
@@ -141,6 +129,10 @@ stringData:
|
||||
|
||||
# Entra-ID-SSO ("Mit Microsoft anmelden"), siehe .env.example fuer die
|
||||
# Einrichtung in Azure. Leer = der Anmeldeknopf erscheint gar nicht erst.
|
||||
# Dieselbe App versendet auch die Shop-E-Mails (SMTP_USER oben, Berechtigung
|
||||
# SMTP.SendAsApp) — ohne diese Werte also auch kein Mailversand. Das
|
||||
# Client-Secret laeuft ab (hoechstens 24 Monate): Ablaufdatum im Kalender
|
||||
# eintragen, sonst fallen Anmeldung UND Mails gleichzeitig aus.
|
||||
# ENTRA_REDIRECT_URI muss exakt der in Azure hinterlegten Adresse
|
||||
# entsprechen und auf die echte Domain zeigen:
|
||||
# https://wabenhain.com/api/auth/entra/callback
|
||||
|
||||
Reference in new issue
Block a user