The authentication function is not turned on in airflow with the default webserver setting. Although there is no operational access from the outside, I want to add it! I think there are people who say that, so that method. Or rather, the basics are written in the document, so if you look here you can do everything. https://pythonhosted.org/airflow/security.html
There are LDAP and GHE, but this time the most basic email, pass
First of all, you need flask_bcrypt
to use authentication, so install it
pip install flask_bcrypt
After that, you should be able to handle it with the standard one
Since ʻauthenticate` is initially False, comment it out or set it to True.
authenticate = True
auth_backend = airflow.contrib.auth.backends.password_auth
Create a user from the command line.
Open the console with the python
command, change the following user information, and press Enter to complete user creation.
import airflow
from airflow import models, settings
from airflow.contrib.auth.backends.password_auth import PasswordUser
user = PasswordUser(models.User())
user.username = '[Any username]'
user.email = '[Any email address]'
user.password = '[Any password]'
session = settings.Session()
session.add(user)
session.commit()
session.close()
exit()
If you restart the web server with this, the following screen should be displayed
It seems that you can't set the permissions. ??
Recommended Posts