Skip to content

Jenkins does not use username and password for basic auth

Overview

The Jenkins CI service webhook does not utilise the username and password provided in the settings page for basic auth against a Jenkins instance.

Reproduce

  1. Enable the Jenkins service on a new non-empty repository
  2. Fill in all required details
  3. On the host run sudo nc -l 8080
  4. Click "Test settings"

Actual

No basic auth headers are sent in the request

root@gitlab-latest-us:~# nc -l 80
POST /project/test_project HTTP/1.1
Content-Type: application/json
X-Gitlab-Event: Push Hook
Connection: close
Host: test.mrchris.me
Content-Length: 1747

Expected

Username and password are sent in the authentication headers.

Workaround

Placing the username and password in Jenkins url field will force the hook to use basic auth. Example: http://test:test@test.mrchris.me


https://gitlab.zendesk.com/agent/tickets/30882