forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add info on creating initial user in password_auth backend
- Loading branch information
1 parent
a0e41d3
commit a9482c6
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,29 @@ uses bcrypt before storing passwords. | |
authenticate = True | ||
auth_backend = airflow.contrib.auth.backends.password_auth | ||
When password auth is enabled, an initial user credential will need to be created before anyone can login. An initial | ||
user was not created in the migrations for this authenication backend to prevent default Airflow installations from | ||
attack. Creating a new user has to be done via a Python REPL on the same machine Airflow is installed. | ||
|
||
.. code-block:: bash | ||
# navigate to the airflow installation directory | ||
$ cd ~/airflow | ||
$ python | ||
Python 2.7.9 (default, Feb 10 2015, 03:28:08) | ||
Type "help", "copyright", "credits" or "license" for more information. | ||
>>> import airflow | ||
>>> from airflow import models, settings | ||
>>> from airflow.contrib.auth.backends.password_auth import PasswordUser | ||
>>> user = PasswordUser(models.User()) | ||
>>> user.username = 'new_user_name' | ||
>>> user.email = '[email protected]' | ||
>>> user.password = 'set_the_password' | ||
>>> session = settings.Session() | ||
>>> session.add(user) | ||
>>> session.commit() | ||
>>> session.close() | ||
>>> exit() | ||
LDAP | ||
'''' | ||
|