emin-ozata opened a new issue, #61244:
URL: https://github.com/apache/airflow/issues/61244

   ### Apache Airflow version
   
   3.1.6
   
   ### If "Other Airflow 3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   When copying the Airflow base URL from the browser address bar, it typically 
includes a trailing slash by default.
   
   Using this URL directly with airflowctl auth login causes the client to 
construct the auth endpoint with a double slash (//auth), which results in a 
failed authentication request.
   
   
   
[airflow/airflow-ctl/src/airflowctl/api/client.py](https://github.com/apache/airflow/blob/f5e70fc34f1999e4800f6dcd9713bb56484d5002/airflow-ctl/src/airflowctl/api/client.py#L224C1-L231C36)
   
   ```python
   #@classmethod
   def _get_base_url(
       cls, base_url: str, kind: Literal[ClientKind.AUTH, ClientKind.CLI] = 
ClientKind.CLI
   ) -> str:
       """Get the base URL of the client."""
       if kind == ClientKind.AUTH:
           return f"{base_url}/auth"
       return f"{base_url}/api/v2"
   ``` 
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   Run `airflowctl auth login` with an `--api-url` value that ends with a 
trailing slash (/).
   
   ```
   airflowctl auth login \
     --username airflow \
     --password airlfow \
     --api-url http://localhost:8080/
   ```
   
   
   ```
   2026-01-30 11:21:20 [warning  ] Server error                   
[airflowctl.api.client] extra={'detail': 'Method Not Allowed'}
   Login failed: Client error message: {'detail': 'Method Not Allowed'}
   ```
   
   ### Operating System
   
   Darwin Kernel Version 25.2.0
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] 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]

Reply via email to