Reputation: 21
I enabled basic authentication in Airflow, but now I can't see most of the Admin -menu items. For example I can't create connections using the UI.
I'm using apache-airflow 1.10.2 and in the config I set:
authenticate = True
auth_backend = airflow.contrib.auth.backends.password_auth
Upvotes: 2
Views: 2186
Reputation: 41
When creating a new user: You can follow the directions here. Then you should also make the user a "superuser".
# after user.password = 'set_the_password'
>>> user.superuser = True
...
If you already created the user you can change it this way:
$ python
>>> import airflow
>>> from airflow import models, settings
>>> from airflow.contrib.auth.backends.password_auth import PasswordUser
>>> session = settings.Session()
>>> user = session.query(models.User).filter(models.User.username == {{ username you previously created }}).first()
>>> user.superuser = True
>>> session.add(user)
>>> session.commit()
>>> session.close()
>>> exit()
Upvotes: 4
Reputation: 7815
To access the admin functions the user must be in the Admin role. You can create an admin user with the Airflow CLI:
airflow create_user -r Admin -u myadmin -p secret_password
Upvotes: 0