From fa44a5343b65e9f223f645c340cd528e7112a5f5 Mon Sep 17 00:00:00 2001 From: Jin <22962980+JYC333@users.noreply.github.com> Date: Fri, 6 Jun 2025 17:12:13 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20support=20custon=20oidc?= =?UTF-8?q?=20server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/server/src/assets/config-sample.ini | 12 ++++++++++++ apps/server/src/services/config.ts | 14 +++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/apps/server/src/assets/config-sample.ini b/apps/server/src/assets/config-sample.ini index f89790163..41eb3d2b6 100644 --- a/apps/server/src/assets/config-sample.ini +++ b/apps/server/src/assets/config-sample.ini @@ -55,3 +55,15 @@ oauthClientId= # Set the client secret for OAuth/OpenID authentication # This is the secret of the client that will be used to verify the user's identity oauthClientSecret= + +# Set the issuer base URL for OAuth/OpenID authentication +# This is the base URL of the service that will be used to verify the user's identity +oauthIssuerBaseUrl= + +# Set the issuer name for OAuth/OpenID authentication +# This is the name of the service that will be used to verify the user's identity +oauthIssuerName= + +# Set the issuer icon for OAuth/OpenID authentication +# This is the icon of the service that will be used to verify the user's identity +oauthIssuerIcon= diff --git a/apps/server/src/services/config.ts b/apps/server/src/services/config.ts index 2089c03ce..d88236b52 100644 --- a/apps/server/src/services/config.ts +++ b/apps/server/src/services/config.ts @@ -46,6 +46,9 @@ export interface TriliumConfig { oauthBaseUrl: string; oauthClientId: string; oauthClientSecret: string; + oauthIssuerBaseUrl: string; + oauthIssuerName: string; + oauthIssuerIcon: string; }; } @@ -123,7 +126,16 @@ const config: TriliumConfig = { process.env.TRILIUM_OAUTH_CLIENT_ID || iniConfig?.MultiFactorAuthentication?.oauthClientId || "", oauthClientSecret: - process.env.TRILIUM_OAUTH_CLIENT_SECRET || iniConfig?.MultiFactorAuthentication?.oauthClientSecret || "" + process.env.TRILIUM_OAUTH_CLIENT_SECRET || iniConfig?.MultiFactorAuthentication?.oauthClientSecret || "", + + oauthIssuerBaseUrl: + process.env.TRILIUM_OAUTH_ISSUER_BASE_URL || iniConfig?.MultiFactorAuthentication?.oauthIssuerBaseUrl || "https://accounts.google.com", + + oauthIssuerName: + process.env.TRILIUM_OAUTH_ISSUER_NAME || iniConfig?.MultiFactorAuthentication?.oauthIssuerName || "Google", + + oauthIssuerIcon: + process.env.TRILIUM_OAUTH_ISSUER_ICON || iniConfig?.MultiFactorAuthentication?.oauthIssuerIcon || "" } };