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

   ### Under which category would you file this issue?
   
   Providers
   
   ### Apache Airflow version
   
   main (Airflow 3.0+)
   
   ### Apache Airflow Provider(s)
   
   amazon
   
   ### What happened and how to reproduce it?
   
   In `AwsAuthManager.get_url_login()`, the `next_url` parameter is currently 
dropped:
   
   ```python
   def get_url_login(self, **kwargs) -> str:
       return urljoin(self.apiserver_endpoint, 
f"{AUTH_MANAGER_FASTAPI_APP_PREFIX}/login")
   ```
   
   When callers (such as Airflow FastAPI/UI redirect handlers) call 
`auth_manager.get_url_login(next_url=...)`, the `next` query parameter is not 
appended to the login URL.
   
   While #77209 updated `AwsAuthManager` login routes to preserve and redirect 
to the `next` URL across SAML authentication callbacks, 
`AwsAuthManager.get_url_login()` itself was left without `next_url` handling.
   
   Other auth managers in Airflow already support `next_url` in 
`get_url_login()`:
   - `KeycloakAuthManager` in #76362:
     ```python
     if next_url := kwargs.get("next_url"):
         return f"{login_url}?{urlencode({'next': next_url})}"
     ```
   - `FabAuthManager` in #73134:
     ```python
     next_url = kwargs.get("next_url")
     if next_url:
         return f"{login_url}?{urlencode({'next': next_url})}"
     ```
   - `SimpleAuthManager` in #67483
   
   ### What you think should happen instead?
   
   `AwsAuthManager.get_url_login()` should accept `next_url` via 
`kwargs.get("next_url")` and append `?next=<url>` (URL-encoded) when present, 
aligning it with Keycloak, FAB, and Simple auth managers.
   
   ### Operating System
   
   Linux
   
   ### Deployment
   
   Other
   
   ### 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
   


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