Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webserver redirects to main page when user is not logged in #36832

Closed
2 tasks done
csp33 opened this issue Jan 17, 2024 · 4 comments · Fixed by #36833
Closed
2 tasks done

Webserver redirects to main page when user is not logged in #36832

csp33 opened this issue Jan 17, 2024 · 4 comments · Fixed by #36833
Assignees
Labels
area:core kind:bug This is a clearly a bug

Comments

@csp33
Copy link
Contributor

csp33 commented Jan 17, 2024

Apache Airflow version

2.8.0

If "Other Airflow 2 version" selected, which one?

No response

What happened?

When opening the log of a specific Airflow DAG/log/whatever (like <my airflow host>/log?execution_date=<date>&task_id=<task_id>&dag_id=<dag_id>&map_index=<map_index>), the user is redirected to the login page if he's not logged in.
However, when the login is performed, the homepage of the webserver is shown, instead of the URL that was initially opened.

What you think should happen instead?

No response

How to reproduce

  1. Enter into Airflow and copy the URL of a specific DAG (i.e <my host>/dags/<my_dag>/grid).
  2. Log out
  3. Paste the URL you copied -> you'll be redirected to the login page.
  4. Login
  5. See how you'll be redirected to the home page.

Operating System

Docker image

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

I found out that this logic is implemented in

def get_url_login(self, **kwargs) -> str:

return url_for(f"{self.security_manager.auth_view.endpoint}.login", next=kwargs["next_url"])

However, we're calling this function using next
return redirect(get_auth_manager().get_url_login(next=request.url))

Changing next to next_url should do the trick 😄

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@csp33 csp33 added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Jan 17, 2024
@aritra24 aritra24 removed the needs-triage label for new issues that we didn't triage yet label Jan 17, 2024
@foldvari
Copy link

I still see the same issue in Airflow 2.8.4
But if I replace 'next_url' by 'next' in the URL then it starts working.

@vincbeck
Copy link
Contributor

What version of provider are you using? I guess the fixes you are looking for are here: #37225 and #37904

@foldvari
Copy link

foldvari commented Jul 24, 2024

What version of provider are you using? I guess the fixes you are looking for are here: #37225 and #37904

@vincbeck Thanks, it seems #37904 addresses the issue. Which version will have this fix?
Which provider are you interested in?

@vincbeck
Copy link
Contributor

#37904 is a provider change so it is not a matter of Airflow version, it is a matter for fab provider version. I cannot see from the PR which version of FAB provider it is in but if you use the last, it should fix your issue. https://pypi.org/project/apache-airflow-providers-fab/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core kind:bug This is a clearly a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants