lnryan opened a new issue #14423:
URL: https://github.com/apache/airflow/issues/14423


   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the 
following questions.
   Don't worry if they're not all applicable; just try to include what you can 
:-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   **Apache Airflow version**: 2.0.1
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**: NA
   - **OS** (e.g. from /etc/os-release): Mac
   - **Kernel** (e.g. `uname -a`): NA
   - **Install tools**: docker-compose
   - **Others**:
   
   **What happened**:
   
   When following [this Quickstart for 
Docker](https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html),
 the section under "Sending requests to the web api" do not work. They return 
Unauthorized. It looks like it's because in the docker config access defaults 
to `deny_all`.
   
   **What you expected to happen**:
   
   The request in the guide should return a 200 response.
   `ENDPOINT_URL="http://localhost:8080/"; curl -X GET -u "airflow:airflow"  
"${ENDPOINT_URL}/api/v1/pools"  `
   
   **How to reproduce it**:
   
   Walk through the Quick Start for Docker, follow each command. Do not change 
any of the configuration. Then try the curl example.
   
   ```
   curl -LfO 
'https://airflow.apache.org/docs/apache-airflow/2.0.1/docker-compose.yaml'
   mkdir -p ./dags ./logs ./plugins
   echo -e "AIRFLOW_UID=$(id -u)\nAIRFLOW_GID=0" > .env
   docker-compose up airflow-init
   
   docker-compose up
   ```
   
   in a separate terminal window
   ```
   ENDPOINT_URL="http://localhost:8080/"; \
   curl -X GET \
    --user "airflow:airflow" \
     "${ENDPOINT_URL}/api/v1/pools"  
   ```
   
   returns 
   ```
   {
     "detail": null,
     "status": 401,
     "title": "Unauthorized",
     "type": 
"https://airflow.apache.org/docs/2.0.1/stable-rest-api-ref.html#section/Errors/Unauthenticated";
   }
   
   ```
   
   Trying the same via the swaqqer endpoint also fails, even when entering the 
credential into the "Authorize" dialog.
   
   **Anything else we need to know**:
   
   checking the permissions via `./airflow.sh airflow config get-value api 
auth_backend` returns `airflow.api.auth.backend.deny_all`
   
   Creating a new `airflow.cfg` file and adding the below does not change the 
configuration upon restart, with either `default` or `basic_auth`
   
   ```
   [api]
   auth_backend = airflow.api.auth.backend.default
   
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to