Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33a42bc

Browse files
authored
Docs: Authentication (langflow-ai#4476)
* initial-cleanup* more* docs: update authentication configuration guide for version 0.5* introduce-table* tech-and-docs-review
1 parentf32360f commit33a42bc

File tree

1 file changed

+64
-96
lines changed

1 file changed

+64
-96
lines changed

‎docs/docs/Configuration/configuration-authentication.md‎

Lines changed: 64 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -4,149 +4,117 @@ sidebar_position: 0
44
slug:/configuration-authentication
55
---
66

7+
The login functionality in Langflow serves to authenticate users and protect sensitive routes in the application.
78

9+
Starting from version 0.5, Langflow introduces an enhanced login mechanism that is governed by a few environment variables. This allows new secure features.
810

9-
:::info
11+
##Create a superuser and new users in Langflow
1012

11-
This page may contain outdated information. It will be updated as soon as possible.
13+
Learn how to create a new superuser, log in to Langflow, and add new users.
1214

13-
:::
14-
15-
16-
17-
18-
##Sign Up and Sign In {#f480dac5d2094d75a433de0b8e195641}
19-
20-
21-
---
15+
1. Create a`.env` file and open it in your preferred editor.
2216

17+
2. Add the following environment variables to your file.
2318

24-
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.
25-
26-
27-
##Environment Variables {#3ed7cae6f5324ba0ac14783cf2a6cc07}
28-
29-
30-
The following environment variables are crucial in configuring the login settings:
31-
32-
-_`LANGFLOW_AUTO_LOGIN`_: Determines whether Langflow should automatically log users in. Default is`True`.
33-
-_`LANGFLOW_SUPERUSER`_: The username of the superuser.
34-
-_`LANGFLOW_SUPERUSER_PASSWORD`_: The password for the superuser.
35-
-_`LANGFLOW_SECRET_KEY`_: A key used for encrypting the superuser's password.
36-
-_`LANGFLOW_NEW_USER_IS_ACTIVE`_: Determines whether new users are automatically activated. Default is`False`.
19+
```bash
20+
LANGFLOW_AUTO_LOGIN=False
21+
LANGFLOW_SUPERUSER=admin
22+
LANGFLOW_SUPERUSER_PASSWORD=securepassword
23+
LANGFLOW_SECRET_KEY=randomly_generated_secure_key
24+
LANGFLOW_NEW_USER_IS_ACTIVE=False
25+
```
3726

38-
All of these variables can be passed to the CLI command_`langflow run`_ through the_`--env-file`_ option. For example:
27+
For more information, see[Authentication configuration values](#values).
3928

29+
:::tip
30+
The Langflow project includes a[`.env.example`](https://github.com/langflow-ai/langflow/blob/main/.env.example) file to help you get started.
31+
You can copy the contents of this file into your own`.env` file and replace the example values with your own preferred settings.
32+
:::
4033

41-
```shell
42-
langflow run --env-file .env
34+
3. Save your`.env` file.
35+
4. Run Langflow with the configured environment variables.
4336

37+
```bash
38+
python -m langflow run --env-file .env
4439
```
4540

41+
5. Sign in with your username`admin` and password`securepassword`.
42+
6. To open the**Admin Page**, click your user profile image, and then select**Admin Page**.
43+
You can also go to`http://127.0.0.1:7861/admin`.
44+
7. To add a new user, click**New User**, and then add the**Username** and**Password**.
45+
8. To activate the new user, select**Active**.
46+
The user can only sign in if you select them as**Active**.
47+
9. To give the user`superuser` priveleges, click**Superuser**.
48+
10. Click**Save**.
49+
11. To confirm your new user has been created, sign out of Langflow, and then sign back in using your new**Username** and**Password**.
4650

47-
:::caution
51+
##Manage Superuser with the Langflow CLI
4852

49-
It is critical not to expose these environment variables in your code repository. Always set them securely in your deployment environment,forexample, using Docker secrets, Kubernetes ConfigMaps/Secrets, or dedicated secure environment configuration systems like AWS Secrets Manager.
53+
Langflow provides a command-line utilityforinteractively creating superusers:
5054

55+
1. Enter the CLI command:
5156

52-
:::
57+
```bash
58+
langflow superuser
59+
```
60+
2. Langflow prompts you for a**Username** and**Password**:
5361

62+
```
63+
langflow superuser
64+
Username: new_superuser_1
65+
Password:
66+
Default folder created successfully.
67+
Superuser created successfully.
68+
```
5469

70+
3. To confirm your new superuser was created successfully, go to the**Admin Page** at`http://127.0.0.1:7861/admin`.
5571

72+
##Authentication configuration values {#values}
5673

57-
###_`LANGFLOW_AUTO_LOGIN`_ {#8b10059e0fbc44f3bc8ce63fe7692e7e}
74+
The following table lists the available authentication configuration variables, their descriptions, and default values:
5875

76+
| Variable| Description| Default|
77+
|----------|-------------|---------|
78+
|`LANGFLOW_AUTO_LOGIN`| Enables automatic login|`True`|
79+
|`LANGFLOW_SUPERUSER`| Superuser username| -|
80+
|`LANGFLOW_SUPERUSER_PASSWORD`| Superuser password| -|
81+
|`LANGFLOW_SECRET_KEY`| Key for encrypting superuser password| -|
82+
|`LANGFLOW_NEW_USER_IS_ACTIVE`| Automatically activates new users|`False`|
5983

60-
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.
84+
###LANGFLOW_AUTO_LOGIN
6185

86+
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.
6287

6388
To disable automatic login and enforce user authentication:
6489

65-
6690
```shell
6791
export LANGFLOW_AUTO_LOGIN=False
6892
```
6993

94+
###LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD
7095

71-
###_`LANGFLOW_SUPERUSER`_ and_`LANGFLOW_SUPERUSER_PASSWORD`_ {#a61a651a0fc7443a82cec93c07a14503}
72-
73-
74-
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.
75-
76-
96+
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.
7797
To create a superuser manually:
7898

79-
80-
```shell
99+
```bash
81100
export LANGFLOW_SUPERUSER=admin
82101
export LANGFLOW_SUPERUSER_PASSWORD=securepassword
83102
```
84103

85-
86-
You can also use the CLI command`langflow superuser` to set up a superuser interactively.
87-
88-
89-
###_`LANGFLOW_SECRET_KEY`_ {#977aea34e6174c58bd76107990d62a1f}
90-
104+
###LANGFLOW_SECRET_KEY
91105

92106
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.
93107

94-
95-
```shell
108+
```bash
96109
export LANGFLOW_SECRET_KEY=randomly_generated_secure_key
97-
98-
```
99-
100-
101-
###_`LANGFLOW_NEW_USER_IS_ACTIVE`_ {#c8f5df9283be4e20be51e14518f5272e}
102-
103-
104-
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.
105-
106-
107-
##Manage superusers with the CLI {#3b0c36a5cc0f4acc95c884d3de858d46}
108-
109-
110-
Langflow provides a command-line utility for managing superusers:
111-
112-
113-
```shell
114-
langflow superuser
115110
```
116111

112+
###LANGFLOW_NEW_USER_IS_ACTIVE
117113

118-
This command prompts you to enter the username and password for the superuser, unless they are already set using environment variables.
119-
120-
121-
##Sign in {#736ebb8c854b4c268d5e748c119a08ea}
122-
123-
124-
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.
125-
126-
127-
![](./1009571828.png)
128-
129-
130-
##Profile settings {#dd5926e12471448d99bd6849d2149dc8}
131-
132-
133-
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:
134-
135-
-**Admin Page**: Opens the admin page, which is only accessible to the superuser.
136-
-**Profile Settings**: Opens the profile settings page.
137-
-**Sign Out**: Logs the user out.
138-
139-
![](./563306242.png)
140-
141-
142-
Select**Profile Settings** to change your password and your profile picture.
143-
114+
By default, this variable is set to`False`. When enabled, new users are automatically activated and can log in without requiring explicit activation by the superuser.
144115

145-
![](./1813063533.png)
146116

147117

148-
Select**Admin Page** to manage users and groups as the superuser.
149118

150119

151-
![](./383358552.png)
152120

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp