Skip to content

SimpleAuthManager: preserve deep-link next URL on first login#67965

Open
GayathriSrividya wants to merge 1 commit into
apache:mainfrom
GayathriSrividya:fix/simple-auth-next-67476
Open

SimpleAuthManager: preserve deep-link next URL on first login#67965
GayathriSrividya wants to merge 1 commit into
apache:mainfrom
GayathriSrividya:fix/simple-auth-next-67476

Conversation

@GayathriSrividya
Copy link
Copy Markdown
Contributor

@GayathriSrividya GayathriSrividya commented Jun 3, 2026

Fixes #67476

When unauthenticated users opened a deep link, some login paths called get_url_login(next_url=...). SimpleAuthManager ignored this kwarg, so it always redirected to /auth/login or /auth/token/login without preserving next, which caused users to land on the homepage after their first login.

This change makes SimpleAuthManager.get_url_login honor the optional next_url argument by appending a URL-encoded next query parameter for both regular and all-admin login endpoints.

Added unit tests for:

  • Regular login with next_url
  • All-admin login with next_url

Validation:

  • /opt/homebrew/bin/ruff format + check --fix passed
  • Local pytest run failed in this workspace due to a missing test dependency: tests_common

@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Jun 3, 2026
@vincbeck
Copy link
Copy Markdown
Contributor

vincbeck commented Jun 3, 2026

Fixed in #67483?

@GayathriSrividya GayathriSrividya force-pushed the fix/simple-auth-next-67476 branch from fd5f692 to 71b9a0c Compare June 3, 2026 17:50
@GayathriSrividya
Copy link
Copy Markdown
Contributor Author

GayathriSrividya commented Jun 3, 2026

Good question. I checked this against #67483, and there is still a gap this PR covers.

What #67483 fixed:

  • It updated the /auth/token/login route to honor a next query param if present.

What it did not change:

  • SimpleAuthManager.get_url_login still ignored next_url and always returned /auth/login or /auth/token/login without appending next.

Why this still matters:

  • FAB call sites already pass next_url into get_url_login:
    • providers/fab/src/airflow/providers/fab/www/auth.py
    • providers/fab/src/airflow/providers/fab/www/extensions/init_appbuilder.py
  • Because SimpleAuthManager discarded next_url, deep-link context was lost before reaching /auth/token/login.

So #67483 handles consumption of next, while this PR handles propagation of next into the login URL generation path.

@GayathriSrividya GayathriSrividya force-pushed the fix/simple-auth-next-67476 branch 2 times, most recently from 2bdfc57 to 24fff64 Compare June 3, 2026 20:11
@GayathriSrividya GayathriSrividya force-pushed the fix/simple-auth-next-67476 branch from 24fff64 to 20142fa Compare June 3, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SimpleAuthManager: deep links redirect to homepage on first visit (next parameter ignored during auto-login)

2 participants