Self HostingAuthentication and SSO
Version: v3

Authentication and SSO

Langfuse supports both email/password and SSO authentication.

Email/Password

Email/password authentication is enabled by default. Users can sign up and log in using their email and password.

To disable email/password authentication, set AUTH_DISABLE_USERNAME_PASSWORD=true. In this case, you need to set up SSO instead.

If you want to provision a default user for your Langfuse instance, you can use the LANGFUSE_INIT_* environment variables.

Password Reset

  • If transactional emails are configured on your instance via the SMTP_CONNECTION_URL and EMAIL_FROM_ADDRESS environments, users can reset their password by using the “Forgot password” link on the login page.

  • If transactional emails are not set up, passwords can be reset by following these steps:

  1. Update the email associated with your user account in database, such as by adding a prefix.
  2. You can then sign up again with a new password.
  3. Reassign any organizations you were associated with via the organization_memberships table in database.
  4. Finally, remove the old user account from the users table in database.

SSO

To enable OAuth/SSO provider sign-in for Langfuse, add the following environment variables:

ProviderVariablesOAuth Redirect URL
GoogleAUTH_GOOGLE_CLIENT_ID
AUTH_GOOGLE_CLIENT_SECRET

AUTH_GOOGLE_ALLOW_ACCOUNT_LINKING=true (optional)
AUTH_GOOGLE_ALLOWED_DOMAINS=langfuse.com,google.com(optional, list of allowed domains based on hd OAuth claim)
/api/auth/callback/google
GitHubAUTH_GITHUB_CLIENT_ID
AUTH_GITHUB_CLIENT_SECRET

AUTH_GITHUB_ALLOW_ACCOUNT_LINKING=true (optional)
/api/auth/callback/github
GitHub EnterpriseAUTH_GITHUB_ENTERPRISE_CLIENT_ID
AUTH_GITHUB_ENTERPRISE_CLIENT_SECRET
AUTH_GITHUB_ENTERPRISE_BASE_URL

AUTH_GITHUB_ENTERPRISE_ALLOW_ACCOUNT_LINKING=false (optional)
/api/auth/callback/github-enterprise
GitLabAUTH_GITLAB_CLIENT_ID
AUTH_GITLAB_CLIENT_SECRET

AUTH_GITLAB_ISSUER (optional)
AUTH_GITLAB_ALLOW_ACCOUNT_LINKING=true (optional)
/api/auth/callback/gitlab
AzureAD/Entra IDAUTH_AZURE_AD_CLIENT_ID
AUTH_AZURE_AD_CLIENT_SECRET
AUTH_AZURE_AD_TENANT_ID

AUTH_AZURE_ALLOW_ACCOUNT_LINKING=true (optional)
/api/auth/callback/azure-ad
OktaAUTH_OKTA_CLIENT_ID
AUTH_OKTA_CLIENT_SECRET
AUTH_OKTA_ISSUER

AUTH_OKTA_ALLOW_ACCOUNT_LINKING=true (optional)
/api/auth/callback/okta
Auth0AUTH_AUTH0_CLIENT_ID
AUTH_AUTH0_CLIENT_SECRET
AUTH_AUTH0_ISSUER

AUTH_AUTH0_ALLOW_ACCOUNT_LINKING=true (optional)
/api/auth/callback/auth0
AWS CognitoAUTH_COGNITO_CLIENT_ID
AUTH_COGNITO_CLIENT_SECRET
AUTH_COGNITO_ISSUER

AUTH_COGNITO_ALLOW_ACCOUNT_LINKING=true (optional)
/api/auth/callback/cognito
KeycloakAUTH_KEYCLOAK_CLIENT_ID
AUTH_KEYCLOAK_CLIENT_SECRET
AUTH_KEYCLOAK_ISSUER

AUTH_KEYCLOAK_ALLOW_ACCOUNT_LINKING=true (optional)
/api/auth/callback/keycloak
Custom OAuth (source)AUTH_CUSTOM_CLIENT_ID
AUTH_CUSTOM_CLIENT_SECRET
AUTH_CUSTOM_ISSUER
AUTH_CUSTOM_NAME (any, used only in UI)

AUTH_CUSTOM_ALLOW_ACCOUNT_LINKING=true (optional)

AUTH_CUSTOM_SCOPE (optional, defaults to "openid email profile")
/api/auth/callback/custom

Use *_ALLOW_ACCOUNT_LINKING to allow merging accounts with the same email address. This is useful when users sign in with different providers or email/password but have the same email address. You need to be careful with this setting as it can lead to security issues if the emails are not verified.

Need another provider? Langfuse uses Auth.js, which integrates with many providers. Add a feature request on GitHub if you want us to add support for a specific provider.

Additional configuration

VariableDescription
AUTH_DOMAINS_WITH_SSO_ENFORCEMENTComma-separated list of domains that are only allowed to sign in using SSO. Email/password sign in is disabled for these domains. E.g. domain1.com,domain2.com
AUTH_DISABLE_SIGNUPSet to true to disable sign up for new users. Only existing users can sign in. This affects all new users that try to sign up, also those who received an invite to a project and have no account yet.
AUTH_SESSION_MAX_AGESet the maximum age of the session (JWT) in minutes. The default is 30 days (43200). The value must be greater than 5 minutes, as the front-end application refreshes its session every 5 minutes.

Was this page useful?

Questions? We're here to help

Subscribe to updates