Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not work when proxy requires auth and supports NTLM #248

Open
afflux opened this issue Apr 16, 2021 · 0 comments
Open

does not work when proxy requires auth and supports NTLM #248

afflux opened this issue Apr 16, 2021 · 0 comments
Labels

Comments

@afflux
Copy link

afflux commented Apr 16, 2021

Version report

Jenkins and plugins versions report:

Jenkins: 2.277.2
OS: Linux - 4.4.121-92.129-default
---
cloudbees-folder:6.15
docker-commons:1.17
jdk-tool:1.5
script-security:1.76
jsch:0.1.55.2
command-launcher:1.5
docker-workflow:1.26
structs:1.22
workflow-step-api:2.23
workflow-api:2.42
junit:1.49
git-client:3.7.1
bouncycastle-api:2.20
antisamy-markup-formatter:2.1
token-macro:2.15
build-timeout:1.20
credentials:2.3.17
scm-api:2.6.4
git-server:1.9
ssh-credentials:1.18.1
workflow-cps-global-lib:2.18
plain-credentials:1.7
credentials-binding:1.24
timestamper:1.12
workflow-support:3.8
durable-task:1.35
workflow-durable-task-step:2.38
display-url-api:2.3.4
matrix-project:1.18
resource-disposer:0.15
ws-cleanup:0.39
ant:1.11
git:4.7.1
gradle:1.36
pipeline-graph-analysis:1.10
pipeline-milestone-step:1.3.2
mailer:1.34
jquery-detached:1.2.1
jackson2-api:2.12.2
ace-editor:1.1
workflow-scm-step:2.12
workflow-cps:2.90
branch-api:2.6.3
pipeline-input-step:2.12
pipeline-stage-step:2.5
workflow-job:2.40
pipeline-rest-api:2.19
handlebars:3.0.8
mapdb-api:1.0.9.0
momentjs:1.1.1
workflow-multibranch:2.23
pipeline-stage-view:2.19
authentication-tokens:1.4
pipeline-build-step:2.13
pipeline-model-api:1.8.4
pipeline-model-extensions:1.8.4
workflow-basic-steps:2.23
pipeline-stage-tags-metadata:1.8.4
pipeline-model-definition:1.8.4
lockable-resources:2.10
workflow-aggregator:2.6
pipeline-github-lib:1.0
plugin-util-api:2.1.0
cloudbees-bitbucket-branch-source:2.9.7
Office-365-Connector:4.14.0
email-ext:2.82
openstack-cloud:2.56
cloud-stats:0.27
trilead-api:1.0.13
apache-httpcomponents-client-4-api:4.5.13-1.0
snakeyaml-api:1.27.0
windows-slaves:1.7
subversion:2.14.0
generic-webhook-trigger:1.72
ssh-slaves:1.31.5
pam-auth:1.6
ruby-runtime:0.12
external-monitor-job:1.7
mercurial:2.14
font-awesome-api:5.15.2-2
popper-api:1.16.1-2
handy-uri-templates-2-api:2.1.8-1.0
matrix-auth:2.6.6
checks-api:1.7.0
config-file-provider:3.7.0
atlassian-bitbucket-server-integration:2.1.3
jquery3-api:3.6.0-1
bootstrap4-api:4.6.0-3
echarts-api:5.0.2-1
extended-read-permission:3.2
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Linux

Reproduction steps

  • Jenkins master running behind a corporate proxy that requires authentication.
  • Authentication credentials set up in jenkins system configuration
  • O365 notificaitions fail with
Apr 16, 2021 9:41:19 AM SEVERE org.apache.commons.httpclient.HttpMethodDirector executeConnect
Credentials cannot be used for NTLM authentication: org.apache.commons.httpclient.UsernamePasswordCredentials
org.apache.commons.httpclient.auth.InvalidCredentialsException: Credentials cannot be used for NTLM authentication: org.apache.commons.httpclient.UsernamePasswordCredentials
	at org.apache.commons.httpclient.auth.NTLMScheme.authenticate(NTLMScheme.java:342)
	at org.apache.commons.httpclient.HttpMethodDirector.authenticateProxy(HttpMethodDirector.java:327)
	at org.apache.commons.httpclient.HttpMethodDirector.executeConnect(HttpMethodDirector.java:498)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:178)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:404)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:330)
	at jenkins.plugins.office365connector.HttpWorker.run(HttpWorker.java:83)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Results

Expected result:

Notification works

Actual result:

Notification fails due to HttpClient trying NTLM auth but only receiving UsernamePasswordCredentials here:

client.getState().setProxyCredentials(AuthScope.ANY,
new UsernamePasswordCredentials(username, password));

@afflux afflux added the bug label Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant