简体   繁体   English

403 Forbidden in airflow DAG 触发 API

[英]403 Forbidden in airflow DAG Triggering API

When I am trying to call the API from POSTMAN in Airflow DAG, I am facing a 403 Forbidden error.当我尝试从 Airflow DAG 中的 POSTMAN 调用 API 时,我遇到了 403 Forbidden 错误。 I have enabled the headers for basic authentication with the username and password in Postman. In the airflow.cfg file, I have enabled auth_backend = airflow.contrib.auth.backends.password_auth .我在 Postman 中使用用户名和密码启用了基本身份验证的标头。在 airflow.cfg 文件中,我启用auth_backend = airflow.contrib.auth.backends.password_auth This error occurs when I attempt to work solely in Postman. When I copy the same URL and try it directly in the browser, I am able to access the link.当我尝试单独在 Postman 中工作时会出现此错误。当我复制相同的 URL 并直接在浏览器中尝试时,我能够访问该链接。 I'm having trouble with authorization now that I've enabled authentication.现在我已经启用了身份验证,但在授权方面遇到了麻烦。

I attempted to use the curl command but received the same forbidden error.我尝试使用 curl 命令,但收到了同样的禁止错误。

The airflow version is 1.10. airflow 版本为 1.10。

The basic auth seems fine, it is base64 encoded already.基本身份验证似乎很好,它已经编码为 base64。 403 means you are authorized in the application but this specific action is forbidden. 403 表示您在应用程序中获得授权,但禁止执行此特定操作。 In airflow there are different roles admin/dag manager/operator and not all roles are allowed to do DAG operations.在 airflow 中有不同的角色 admin/dag manager/operator 并且并非所有角色都被允许进行 DAG 操作。 Can you specify the user role and operations you try to do?您能否指定您尝试执行的用户角色和操作? Have in mind that base64 auth string can be easily decoded to plain text and people can see your username and password.请记住,base64 身份验证字符串可以轻松解码为纯文本,人们可以看到您的用户名和密码。 In the picture you have shared the verb you are using is POST, opening the link in tbe browser is probably a GET operation which is different in terms of permissions required.在您分享的图片中,您使用的动词是 POST,在浏览器中打开链接可能是 GET 操作,这在所需权限方面有所不同。

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

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