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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]