Introduction:
Hello everyone, I'm trying to use the REST API of Airflow to active a DAG with external trigger, like:
POST: http://{{url}}:{{port}}/api/experimental/dags/MY_DAG_ID/dag_runs
headers = {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache',
}
Problem:
It's work very well (Answer: Status 200), but I need some security because its not can open for public, so I read on API Authentication, that I can be set auth_backend on airflow.cfg that will worked very similar like Password Authentication used for the Web Interface.
[api]
auth_backend = airflow.contrib.auth.backends.password_auth
But now, the Answer is (401 - Unauthorized) and I don't know how to configure the REST API to use my external trigger with this security.
- Is it necessary to pass my user and password on header to work?
How I can do this?
Let's assume that exist a user: admin, pass: admin and permission: Admin