airflowairflow-api

Airflow 3.0.0 : Rest API : Not authenticated


I am new to Airflow and was able to configure Airflow 3.0.0 with sample docker compose. It is up and running fine. I am able to login to UI and also run dags on UI. I actually want to trigger DAG via Rest, so was trying to access the same via default rest api

curl -X GET 'localhost:8080/api/v2/dags/my_dag' -H 'Content-Type: application/json' --user "airadmin:airpass"

Response : {"detail":"Not authenticated"}

Want to know what configuration changes needs to be done to enable Rest Api execution.

Thanks


Solution

  • Looka at the docs in Airflow 3 you need to get JWT token first and authenticate with the token not with basic authentication for every request.