Files
wekan/docs/Features
Lauri Ojansivu 517bee3f0b Add Sign in with Apple support: server-signed JWT client secret for OAuth2.
Apple's Sign in with Apple is OIDC-compatible, so it works through Wekan's
existing generic OAuth2/OIDC client - except its "client secret" is not a
static string: it must be a short-lived JWT the server signs itself (ES256),
using a private key downloaded from Apple's developer portal. Every other
generic OAuth2 provider Wekan supports (Keycloak, Authelia, Nextcloud, ...)
keeps sending its static OAUTH2_SECRET unchanged.

models/lib/oauth2ClientSecretJwt.js mints that JWT using only Node's built-in
crypto module (no new dependency: ES256 signing with IEEE-P1363 signature
encoding has been supported since Node 12). It is opt-in: when
OAUTH2_SECRET_JWT_KEY_PATH is unset (the default, and every existing
provider's configuration), maybeGenerateOauth2ClientSecretJwt() returns null
and packages/wekan-oidc/oidc_server.js falls back to the static OAUTH2_SECRET
exactly as before.

Apple's other quirk - it returns the user's name only on the very first
authorization - needs no special-casing: Accounts.onCreateUser
(server/models/users.js) already copies the OIDC fullname/email claims into
the user's profile only once, at account creation, and never overwrites them
on later logins (Meteor's updateOrCreateUserFromExternalService only touches
services.oidc.* for a returning user, not profile.*).

docs/Features/Login/Apple.md documents Apple's endpoints and the new env
vars, mirroring the Keycloak/Authelia docs pattern.

Thanks to xet7 !

Closes #2458,
2026-09-10 20:42:42 +03:00
..