如何禁用詹金斯的基本http认证

How to disable basic http auth of jenkins

我的jenkins版本:1.608,运行落后于nginx。

我刚刚从 portage 安装了 jenkins,然后转到 Manage Jenkins > Configure Global Security > 启用 Enable security > 选择 Jenkins’ own user database > 启用 Allow users to sign up > 单击 Save 按钮

然后页面刷新,jenkins让我使用基本的http认证登录,但是我没有添加任何用户,我无法访问注册页面。

我可以在 /var/lib/jenkins/home/config.xml 中禁用 useSecurity,但我想使用 Jenkins’ own user database

而且我从未在 Manage Jenkins 页面中找到 Manage Users

您应该删除 config.xml 中的 authorizationStrategy 和 securityRealm。将 "useSecurity" 保留为 "true"。

我在文件 /var/cache/jenkins/war/WEB-INF/security/SecurityFilters 中提供了帮助。groovy 注释掉了块

bean(BasicHeaderProcessor) {
            // if basic authentication fails (which only happens incorrect basic auth credential is sent),
            // respond with 401 with basic auth request, instead of redirecting the user to the login page,
            // since users of basic auth tends to be a program and won't see the redirection to the form
            // page as a failure
             authenticationEntryPoint = bean(BasicProcessingFilterEntryPoint) {
                realmName = "Jenkins"
            }
        },