airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Unable to login when accessed via iframe

Open nirutgupta opened this issue 2 years ago • 3 comments

Apache Airflow version

Other Airflow 2 version (please specify below)

What happened

Airflow Version : 2.3.2 Helmchart Version: 1.3.0

When trying to login with admin credentials via iframe, it is getting redirected back to login page. Auth getting used : airflow.api.auth.backend.basic_auth

What you think should happen instead

Should be able to login just like how it should be when opened in a new tab.

How to reproduce

webserver: webserverConfig: WTF_CSRF_ENABLED = False

I am using Kubernetes Executor and auth as

api:
    auth_backend: airflow.api.auth.backend.basic_auth

There are multiple webservers pods though it can be reproducible even in one webserver instance setup.

Operating System

apache/airflow:2.3.2-python3.8 this is the image I am using.

Versions of Apache Airflow Providers

2.3.2

Deployment

Official Apache Airflow Helm Chart

Deployment details

I have added the related details under How to reproduce section. Putting the ingress section as well.

ingress:
  # Enable ingress resource
  enabled: true

  # Configs for the Ingress of the web Service
  web:
    # Annotations for the web Ingress
    annotations:
      kubernetes.io/ingress.class: nginx
      nginx.ingress.kubernetes.io/ssl-redirect: "false"
      host: "<internal host>"

Anything else

Proper documentation is lagging for the iframe enable setup. I know this feature is added for security purposes but they should be disabled with the flag.

I have tried adding these two environment variables under webserver config section after searching but no luck. SESSION_COOKIE_SAMESITE = 'None' SAMESITE = 'None'

Also, I am able to render the webserver UI login page on iframe, but the login is not working. If I do not set WTF_CSRF_ENABLED flag to False then the UI throws CSRF session token missing.

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

nirutgupta avatar Jan 23 '23 15:01 nirutgupta

I would like to know if there is any update for this issue. I'm using version 2.5.0. Thank you in advance.

lhmson avatar May 16 '23 14:05 lhmson

If there are no comments - then likely not - but if you woudl like to provide more information or double check in your case (maybe it hs been fixed and it was not noticed) or maybe you woudl like to provide extra diagnostics from your tries or maybe even PR fixing it - feel absolutely free.

In the Open-Source Project like that issues are fixed when someone fixes them - anyone, whoever decides to fix such an issue and generally anything that happens to the issue is in the issue itself, there is nothing hidden. So if somone has an incentive to get an issue fixed and it apparaenlty has no big priority in solving for anyone, a good way to speed up solving an issue i sno get things like that fixes is to help with providing more diagnostics/suggested fix issue or even better provide a PR that fixes it.

potiuk avatar May 16 '23 14:05 potiuk

This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.

github-actions[bot] avatar Oct 20 '24 07:10 github-actions[bot]

This issue has been closed because it has not received response from the issue author.

github-actions[bot] avatar Nov 30 '24 07:11 github-actions[bot]