You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/28 07:48:02 UTC

[GitHub] [airflow] ramwin opened a new issue, #23321: the api.auth_backend setting not working.

ramwin opened a new issue, #23321:
URL: https://github.com/apache/airflow/issues/23321

   ### Apache Airflow version
   
   2.2.5 (latest released)
   
   ### What happened
   
   If I just set the `airflow.cfg` file
   ```
   [api]
   auth_backend = airflow.api.auth.backend.basic_auth
   ```
   the rest api didn't work, it returns
   ```
   {
     "detail": null,
     "status": 401,
     "title": "Unauthorized",
     "type": "https://airflow.apache.org/docs/apache-airflow/2.2.5/stable-rest-api-ref.html#section/Errors/Unauthenticated"
   }
   ```
   
   I found the solution on [stackoverflow](https://stackoverflow.com/a/65593173/3601654). After setting the `AIRFLOW__API__AUTH_BACKEND` environment variable, the rest api works.
   
   ### What you think should happen instead
   
   The rest api show be enabled if I only set the `airflow.cfg`
   
   ### How to reproduce
   
   1. install airflow
   2. change the airflow.cfg
   3. use `airflow standalone` to start
   4. call the rest api.
   
   ### Operating System
   
   Ubuntu 20.04.4 LTS
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-celery==2.1.0
   apache-airflow-providers-ftp==2.0.1
   apache-airflow-providers-http==2.0.2
   apache-airflow-providers-imap==2.1.0
   apache-airflow-providers-sqlite==2.0.1
   apache-airflow-providers-ssh==2.3.0
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   [program:airflow]
   directory = /home/airflow/
   user = airflow
   command = airflow standalone
   autostart=true
   autorestart=true
   stdout_logfile=/var/log/airflow/stdout.log
   stderr_logfile=/var/log/airflow/stderr.log
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ephraimbuddy commented on issue #23321: the api.auth_backend setting not working.

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on issue #23321:
URL: https://github.com/apache/airflow/issues/23321#issuecomment-1111998855

   Let me know if the above steps worked for you


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ephraimbuddy commented on issue #23321: the api.auth_backend setting not working.

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on issue #23321:
URL: https://github.com/apache/airflow/issues/23321#issuecomment-1111998287

   It worked for me.
   After installing airflow. Once you run `airflow standalone` it'll start with default `airflow.cfg`. Stop and set the `auth_backend = airflow.api.auth.backend.basic_auth`. Start `airflow standalone` and it should work.
   
   Steps:
   ```
   mkdir airflow
   python3 -m venv env
   . env/bin/activate
   pip install apache-airflow==2.2.5 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.2.5/constraints-3.8.txt"
   airflow standalone
   ```
   Stop and update `auth_backend = airflow.api.auth.backend.basic_auth` in `airflow.cfg`.
   Works. 
   
   You should make sure that your `airflow.cfg` is in the same directory of the `AIRFLOW_HOME` you are using.
   
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ramwin commented on issue #23321: the api.auth_backend setting not working.

Posted by GitBox <gi...@apache.org>.
ramwin commented on issue #23321:
URL: https://github.com/apache/airflow/issues/23321#issuecomment-1112805660

   It works, thank you, @ephraimbuddy . It's because I start the airflow in the wrong directory. 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ramwin closed issue #23321: the api.auth_backend setting not working.

Posted by GitBox <gi...@apache.org>.
ramwin closed issue #23321: the api.auth_backend setting not working.
URL: https://github.com/apache/airflow/issues/23321


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] boring-cyborg[bot] commented on issue #23321: the api.auth_backend setting not working.

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #23321:
URL: https://github.com/apache/airflow/issues/23321#issuecomment-1111860493

   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org