Authentication
This page may contain outdated information. It will be updated as soon as possible.
Sign Up and Sign In
--
The login functionality in Langflow serves to authenticate users and protect sensitive routes in the application. Starting from version 0.5, Langflow introduces an enhanced login mechanism that is governed by a few environment variables. This allows new secure features.
-Environment Variables
-The following environment variables are crucial in configuring the login settings:
--
-
LANGFLOW_AUTO_LOGIN: Determines whether Langflow should automatically log users in. Default isTrue.
-LANGFLOW_SUPERUSER: The username of the superuser.
-LANGFLOW_SUPERUSER_PASSWORD: The password for the superuser.
-LANGFLOW_SECRET_KEY: A key used for encrypting the superuser's password.
-LANGFLOW_NEW_USER_IS_ACTIVE: Determines whether new users are automatically activated. Default isFalse.
-
All of these variables can be passed to the CLI command langflow run through the --env-file option. For example:
_10langflow run --env-file .env
It is critical not to expose these environment variables in your code repository. Always set them securely in your deployment environment, for example, using Docker secrets, Kubernetes ConfigMaps/Secrets, or dedicated secure environment configuration systems like AWS Secrets Manager.
LANGFLOW_AUTO_LOGIN
-By default, this variable is set to True. When enabled (True), Langflow operates as it did in versions prior to 0.5—automatic login without requiring explicit user authentication.
The login functionality in Langflow serves to authenticate users and protect sensitive routes in the application.
+Starting from version 0.5, Langflow introduces an enhanced login mechanism that is governed by a few environment variables. This allows new secure features.
+Create a superuser and new users in Langflow
+Learn how to create a new superuser, log in to Langflow, and add new users.
+-
+
-
+
Create a
+.envfile and open it in your preferred editor.
+ -
+
Add the following environment variables to your file.
+
+
_10LANGFLOW_AUTO_LOGIN=False_10LANGFLOW_SUPERUSER=admin_10LANGFLOW_SUPERUSER_PASSWORD=securepassword_10LANGFLOW_SECRET_KEY=randomly_generated_secure_key_10LANGFLOW_NEW_USER_IS_ACTIVE=False
For more information, see Authentication configuration values.
+The Langflow project includes a .env.example file to help you get started.
+You can copy the contents of this file into your own .env file and replace the example values with your own preferred settings.
-
+
- Save your
.envfile.
+ - Run Langflow with the configured environment variables. +
_10python -m langflow run --env-file .env
-
+
- Sign in with your username
adminand passwordsecurepassword.
+ - To open the Admin Page, click your user profile image, and then select Admin Page.
+You can also go to
http://127.0.0.1:7861/admin.
+ - To add a new user, click New User, and then add the Username and Password. +
- To activate the new user, select Active. +The user can only sign in if you select them as Active. +
- To give the user
superuserpriveleges, click Superuser.
+ - Click Save. +
- To confirm your new user has been created, sign out of Langflow, and then sign back in using your new Username and Password. +
Manage Superuser with the Langflow CLI
+Langflow provides a command-line utility for interactively creating superusers:
+-
+
- Enter the CLI command: +
_10langflow superuser
-
+
- Langflow prompts you for a Username and Password: +
_10langflow superuser_10Username: new_superuser_1_10Password:_10Default folder created successfully._10Superuser created successfully.
-
+
- To confirm your new superuser was created successfully, go to the Admin Page at
http://127.0.0.1:7861/admin.
+
Authentication configuration values
+The following table lists the available authentication configuration variables, their descriptions, and default values:
+| Variable | Description | Default |
|---|---|---|
LANGFLOW_AUTO_LOGIN | Enables automatic login | True |
LANGFLOW_SUPERUSER | Superuser username | - |
LANGFLOW_SUPERUSER_PASSWORD | Superuser password | - |
LANGFLOW_SECRET_KEY | Key for encrypting superuser password | - |
LANGFLOW_NEW_USER_IS_ACTIVE | Automatically activates new users | False |
LANGFLOW_AUTO_LOGIN
+By default, this variable is set to True. When enabled, Langflow operates as it did in versions prior to 0.5, including automatic login without requiring explicit user authentication.
To disable automatic login and enforce user authentication:
_10export LANGFLOW_AUTO_LOGIN=False
LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD
-These environment variables are only relevant when LANGFLOW_AUTO_LOGIN is set to False. They specify the username and password for the superuser, which is essential for administrative tasks.
To create a superuser manually:
+LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD
+These environment variables are only relevant when LANGFLOW_AUTO_LOGIN is set to False. They specify the username and password for the superuser, which is essential for administrative tasks. +To create a superuser manually:
_10export LANGFLOW_SUPERUSER=admin_10export LANGFLOW_SUPERUSER_PASSWORD=securepassword
You can also use the CLI command langflow superuser to set up a superuser interactively.
LANGFLOW_SECRET_KEY
+LANGFLOW_SECRET_KEY
This environment variable holds a secret key used for encrypting the superuser's password. Make sure to set this to a secure, randomly generated string.
_10export LANGFLOW_SECRET_KEY=randomly_generated_secure_key
LANGFLOW_NEW_USER_IS_ACTIVE
-By default, this variable is set to False. When enabled (True), new users are automatically activated and can log in without requiring explicit activation by the superuser.
Manage superusers with the CLI
-Langflow provides a command-line utility for managing superusers:
-
_10langflow superuser
This command prompts you to enter the username and password for the superuser, unless they are already set using environment variables.
-Sign in
-With LANGFLOW_AUTO_LOGIN set to False, Langflow requires users to sign up before they can log in. The sign-up page is the default landing page when a user visits Langflow for the first time.

Profile settings
-Once signed in, you can change your profile settings by clicking on the profile icon in the top right corner of the Langflow dashboard. This opens a dropdown menu with the following options:
--
-
-
-
Admin Page: Opens the admin page, which is only accessible to the superuser.
-
- -
-
Profile Settings: Opens the profile settings page.
-
- -
-
Sign Out: Logs the user out.
-
-
-
Select Profile Settings to change your password and your profile picture.
-
Select Admin Page to manage users and groups as the superuser.
-
