-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Update UI authentication to handle JWT token in backend #56633
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
Conversation
b585b34 to
4bc8f87
Compare
4bc8f87 to
afe41f5
Compare
17fcb0a to
5a6a1d2
Compare
026762d to
44f0f22
Compare
44f0f22 to
a5142bd
Compare
pierrejeambrun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Backport failed to create: v3-1-test. View the failure log Run details
You can attempt to backport this manually by running: cherry_picker b8af111 v3-1-testThis should apply the commit to the v3-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continue |
|
Backport: #56677 |
|
Invalid parameter: redirect_uri I’ve been working with Airflow and Keycloak, and ran into the same issue: Airflow sends an incorrect redirect_uri using http instead of https, which is insecure. I want it to use https. I’ve tried setting base_url in the config, but it has no effect — the redirect still uses http during the login flow. My Airflow web UI is behind NGINX, which is properly configured to forward all necessary headers and redirect to https. From what I understand, this seems to be a widespread issue, and I’d like to know when it will be fixed. Also, in the newer Airflow versions, I can no longer use the old OIDC config with Flask AppBuilder to temporarily bypass the issue — it's no longer compatible. |
Interesting. I think the issue comes from the fact the api server is behind a proxy. When Airflow does
OIDC authentication has been removed from |
|
We've been trying to avoid setting any responsibility in Airflow for handling https, and leave that up to the proxy to do SSL termination. Similarly can this be fixed at the NGINX level instead? @Romanchyk |
|
@pierrejeambrun According to the documentation you shared, I’ve already configured all the required headers X-Forwarded-Proto. I also tried setting the following environment variable, but it didn’t help:
Next, I’ll try overriding the headers explicitly using serverSnippet, because I’m using a VirtualServer (Kubernetes NGINX custom resource). |
|
@pierrejeambrun |
|
You need to take a more serious approach to setting up Airflow through Keycloak. There’s no documentation, and a lot of errors appear due to the default configurations. There are many issues overall. It would be preferable to use OIDC in newer versions since it’s more stable, or to properly configure and debug the integration with the new manager. |
|
You need to rewrite the You can take a look at
This is all done and maintained mostly by people working on Airflow pro bono and on their free time, the best way to see improvement is to contribute yourself. If you feel like something is not right or need some improvement (documentation, code etc..) feel free to open a PR. That is also the best way to contribute back for the software you get for free. This is especially true for providers that are community maintained, if nobody keeps maintaining them, we might suspend and even remove them at some point. |
|
proxy_redirect won’t help, because this comes from the client — I’m already connecting via HTTPS. It’s not clear whether I can do this through webserver-config. Thank you for your help — I didn’t realize the project was community-driven! |
The best way to improve it is to contribute yourself. Handling all different user cases, user architecture, user configuration is clearly impossible. So if you run into an issue and feel the documentation is not good enough, you are the perfect candidate to make it better. Nobody will do it for you. So please do :) I'll be very happy to review the PR |
You can run the commands described in the documentation to automatically configure the permissions in Keycloak for you. If you can, run it form the api-server since you have already configured access to Keycloak there |
|
Hi, I have been facing this issue with my airflow 3 setup behind my enterprise reverse proxy. I see that this will go out with the 3.1.1 release and there is a tag already created for it in the github repo. I would love to contribute to the project as we go ahead! |
|
This PR will be part of 3.1.1 @saaifali 3.1.1 is being released as we speak, the final version should be out in the next few days, you can follow along on the airflow dev mailing list is you need more information. |
Resolves #55143.
For better simplicity and better security this PR updates the Airflow UI authentication. With this change the front-end no longer needs to handle the JWT token, it makes API calls to Airflow API (public and UI APIs) with no authentication. A fallback mechanism is added to the back-end so that, if no authentication is provided as part of a request, it fetches the JWT token from the cookies (if it exists). This cookie is saved by auth managers like today, the only change is now this cookie is httpOnly, so Javascript cannot read it.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.