简体   繁体   English

使用 Airflow 进行 Azure AD 身份验证

[英]Azure AD authentication with Airflow

TLDR: Where can I find the logs of Flask App Builder to see what's going wrong? TLDR:我在哪里可以找到 Flask App Builder 的日志以查看出了什么问题?

I'm trying to configure Azure AD Oauth2 to let users sign in before using Airflow.我正在尝试配置 Azure AD Oauth2 以让用户在使用 Airflow 之前登录。 I have the following configuration in my webserver_config:我的 webserver_config 中有以下配置:

tenant_id = "id"
OAUTH_PROVIDERS = [
    {
        "name": "azure",
        "icon": "fa-windows",
        "token_key": "access_token",
        "remote_app": {
            "client_id": "id",
            "client_secret": "secret",
            "base_url": "https://login.microsoftonline.com/oauth2",
            "scope": "User.Read",
            "request_token_url": None,
            "access_token_url": "https://login.microsoftonline.com/oauth2/token",
            "authorize_url": f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/authorize",
        },
    },
]

In airflow.cfg, I set rbac = True and [webserver] authenticate = True .在airflow.cfg 中,我设置了rbac = True[webserver] authenticate = True When I start the web server, I get to login but then I'm redirected to an Airflow debug page that gives me a 500 response.当我启动 Web 服务器时,我可以登录,但随后我被重定向到一个 Airflow 调试页面,该页面给出了 500 响应。 Where can I find the logs of Flask App Builder to see what's going wrong?我在哪里可以找到 Flask App Builder 的日志以查看发生了什么问题?

You will need to enable the logs for Flask App Builder by setting this Config param - AIRFLOW__LOGGING__FAB_LOGGING_LEVEL , to appropriate log level.您需要通过将此配置参数 - AIRFLOW__LOGGING__FAB_LOGGING_LEVEL 设置为适当的日志级别来启用 Flask App Builder 的日志。

Refer the docs here https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#fab-logging-level请参阅此处的文档https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#fab-logging-level

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM