Airflow:让用户使用 ldap 登录 [英] Airflow: Get user logged in with ldap

查看:59
本文介绍了Airflow:让用户使用 ldap 登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道我将如何从气流中获取当前用户?我们将后端启用到 airflow/contrib/auth/backends/ldap_auth.py,因此用户通过该身份验证登录,我想知道如何让当前用户点击某些内容(自定义将我们作为插件查看).

Does anyone know how I'll be able to get the current user from airflow? We have our backend enabled to airflow/contrib/auth/backends/ldap_auth.pyand so users log in via that authentication and I want to know how to get the current user that clicks on something (a custom view we have as a plugin).

推荐答案

您可以通过调用{{ current_user.user.username }}{{ current_user.user }} 来获取 在您的 html jenja 模板中.

You can get it by calling {{ current_user.user.username }} or {{ current_user.user }} in your html jenja template.

这篇关于Airflow:让用户使用 ldap 登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆