refactor: reuse the SSO app registration for M365 calendar sync

One Entra enterprise application now covers both interactive login and
the calendar sync's client-credentials Graph access, instead of
requiring a second app registration. GraphClientService reads
OIDC_ISSUER_URL/OIDC_CLIENT_ID/OIDC_CLIENT_SECRET (same as SSO) and
derives the tenant ID from the issuer URL's path, rather than three
dedicated M365_CALENDAR_* env vars. The app registration just needs the
"Calendars.ReadWrite" Application permission added alongside its
existing delegated login scopes.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
Nick SzaunigandClaude Sonnet 5 committed 2026-09-04 14:35:18 +02:00
1 parent e7b157ec35
commit e133a677ab
6 files changed
+70 -44

No files matched your search

@@ -74,9 +74,9 @@ function SettingsForm({ settings }: { settings: CalendarSyncSettings }) {
<form className="flex flex-col gap-4" onSubmit={handleSubmit}>
<p className="text-xs text-muted-foreground">
Überträgt Kalendereinträge einseitig (ApiCore → M365) in den Kalender einer
Microsoft-365-Gruppe. Benötigt eine eigene App-Registrierung in Azure/Entra
(Umgebungsvariablen, siehe .env.example) mit Application-Berechtigung
„Calendars.ReadWrite“ und Admin-Consent.
Microsoft-365-Gruppe. Nutzt dieselbe Azure/Entra-App-Registrierung wie die
Microsoft-Anmeldung (SSO) – dafür muss diese zusätzlich die
Application-Berechtigung „Calendars.ReadWrite“ mit Admin-Consent erhalten.
</p>
<div className="flex items-center gap-2">
<Checkbox
@@ -148,8 +148,9 @@ function StatusSection() {
<p className="text-muted-foreground">Lädt…</p>
) : !status?.configured ? (
<p className="text-muted-foreground">
Nicht konfiguriert - M365_CALENDAR_TENANT_ID/_CLIENT_ID/_CLIENT_SECRET fehlen als
Umgebungsvariable.
Nicht konfiguriert - die SSO-Umgebungsvariablen (OIDC_ISSUER_URL/OIDC_CLIENT_ID/
OIDC_CLIENT_SECRET) fehlen, oder die App-Registrierung hat noch keine
Application-Berechtigung „Calendars.ReadWrite“.
</p>
) : !canRunNow ? (
<p className="text-muted-foreground">