From 99f81fcb78e83a6455550a645975cf1c85283626 Mon Sep 17 00:00:00 2001 From: Till JS Date: Mon, 18 May 2026 16:32:10 +0200 Subject: [PATCH] feat(auth): Cross-App-SSO via shared Keychain-Group ev.mana.session MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migriert die App auf die kanonische shared Keychain-Group `ManaSharedKeychainGroup` aus mana-swift-core. Alle nativen mana-e.V.-Apps (memoro, wordeck, nutriphi, herbatrium, zitare, seepuls, viadocu, manameme, werdrobe, pageta, comicello, moodlit) teilen damit ihren Auth-Token auf demselben Device — ein Login in einer App, alle anderen starten direkt im .signedIn-Status. Wichtig: für echtes Cross-App-Sharing müssen sowohl `keychainService` als auch `keychainAccessGroup` identisch sein (Keychain-Lookup-Tupel `(service, account, accessGroup)`) — beide jetzt auf `ManaSharedKeychainGroup`. Bestehender App-eigener Bucket (`ev.mana.`) wird beim ersten Login mit dem neuen Token überschrieben; User in TestFlight-Apps brauchen einen Re-Login. Voraussetzung Apple-Dev-Portal (Tills manueller Schritt): - Capability "Keychain Sharing" für die App ID aktivieren - Group `ev.mana.session` hinzufügen - Provisioning-Profile neu downloaden (Xcode auto) Co-Authored-By: Claude Opus 4.7 (1M context) --- Sources/Core/Auth/AppConfig.swift | 4 ++-- project.yml | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Sources/Core/Auth/AppConfig.swift b/Sources/Core/Auth/AppConfig.swift index 980eae1..48842b7 100644 --- a/Sources/Core/Auth/AppConfig.swift +++ b/Sources/Core/Auth/AppConfig.swift @@ -14,10 +14,10 @@ enum AppConfig { static let manaAppConfig: ManaAppConfig = DefaultManaAppConfig( authBaseURL: URL(string: "https://auth.mana.how")!, - keychainService: "ev.mana.zitare", + keychainService: ManaSharedKeychainGroup, // Explizit auf TeamID.BundleID, statt nil. Vermeidet Logout // bei TestFlight-Cert-Drift (siehe mana-swift-core v1.5.1). - keychainAccessGroup: "QP3GLU8PH3.ev.mana.zitare", + keychainAccessGroup: ManaSharedKeychainGroup, appGroup: appGroup ) diff --git a/project.yml b/project.yml index d10cb7e..7c222b1 100644 --- a/project.yml +++ b/project.yml @@ -100,7 +100,7 @@ targets: com.apple.security.network.client: true com.apple.security.files.user-selected.read-write: true keychain-access-groups: - - $(AppIdentifierPrefix)ev.mana.zitare + - $(AppIdentifierPrefix)ev.mana.session # Universal-Link-Domains: # - zitare.com ist die kanonische Production-Domain (steht # auch im Manifest und im AASA-File auf zitare-com). @@ -148,6 +148,8 @@ targets: entitlements: path: ShareExtension/Resources/ZitareShareExtension.entitlements properties: + keychain-access-groups: + - $(AppIdentifierPrefix)ev.mana.session com.apple.security.application-groups: - group.ev.mana.zitare settings: @@ -178,6 +180,8 @@ targets: entitlements: path: Widgets/ZitareWidget/Resources/ZitareWidgetExtension.entitlements properties: + keychain-access-groups: + - $(AppIdentifierPrefix)ev.mana.session com.apple.security.application-groups: - group.ev.mana.zitare dependencies: