feat: 🎸 support custon oidc server

This commit is contained in:
Jin 2025-06-06 17:12:13 +02:00 committed by JYC333
parent c8b3cdf01b
commit fa44a5343b
2 changed files with 25 additions and 1 deletions

View File

@ -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=

View File

@ -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 || ""
}
};