docs/self-hosting/environment-variables/auth.mdx
LobeHub provides a complete authentication service capability when deployed. The following are the relevant environment variables. You can use these environment variables to easily define the identity verification services that need to be enabled in LobeHub.
AUTH_SECRETopenssl rand -base64 32.-Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=AUTH_EMAIL_VERIFICATION1 to require email verification before users can sign in. Users must verify their email address after registration.01AUTH_SSO_PROVIDERS-google,github,microsoft,cognitoAUTH_ALLOWED_EMAILS[email protected]) or domain names (e.g., example.com). Leave empty to allow all emails.-example.com,[email protected]AUTH_DISABLE_EMAIL_PASSWORD1 to disable email/password authentication, forcing users to use SSO login only. When enabled, the email input will be hidden on the login page and the signup page will redirect to login.01JWKS_KEY-INTERNAL_JWT_EXPIRATION30s30s, 1m, 1hThese settings are required for email verification and password reset features.
SMTP_HOST-smtp.gmail.comSMTP_PORT587 for TLS or 465 for SSL.-587SMTP_SECUREtrue for port 465 (SSL), false for port 587 (TLS).falsefalseSMTP_USER-[email protected]SMTP_PASS-your-app-specific-passwordSMTP_FROMSMTP_USER is not a valid email address. If not set, defaults to SMTP_USER.SMTP_USER[email protected]AUTH_GOOGLE_ID-123456789.apps.googleusercontent.comAUTH_GOOGLE_SECRET-GOCSPX-xxxxxxxxxxxxxxxxxxxxAUTH_GITHUB_ID-Ov23xxxxxxxxxxxxxAUTH_GITHUB_SECRET-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxAUTH_MICROSOFT_ID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxAUTH_MICROSOFT_SECRET-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxAUTH_MICROSOFT_AUTHORITY_URLhttps://login.microsoftonline.comhttps://login.partner.microsoftonline.cnAUTH_MICROSOFT_TENANT_IDcommonxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxAUTH_COGNITO_ID-xxxxxxxxxxxxxxxxxxxxxAUTH_COGNITO_SECRET-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxAUTH_COGNITO_ISSUERhttps://cognito-idp.{region}.amazonaws.com/{userPoolId}-https://cognito-idp.us-east-1.amazonaws.com/us-east-1_xxxxxxxxxAUTH_FEISHU_APP_ID-cli_xxxxxxxxxxxxxxxxAUTH_FEISHU_APP_SECRET-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxAUTH_WECHAT_ID-wxxxxxxxxxxxxxxxxxxxAUTH_WECHAT_SECRET-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx