cliffano / nestor

Jenkins CLI and node.js client
http://blog.cliffano.com/tag/nestor/
MIT License
181 stars 27 forks source link

Authentication is not working. #37

Closed doque closed 8 years ago

doque commented 8 years ago

Authentication seems to not work for me:

[01:15 PM]-[dbus@mbp]-[~]
$ JENKINS_URL=http://192.168.178.230 nestor --interactive build AdminTool
prompt: Username:  xxx
prompt: Password:
Jenkins requires authentication - set username and password in Jenkins URL

The same occurs when specifying user/password directly in the URL

[01:18 PM]-[dbus@mbp]-[~]
$ JENKINS_URL=http://xxx:pass@192.168.178.230 nestor --interactive build AdminTool
prompt: Username:  xxx
prompt: Password:
Jenkins requires authentication - set username and password in Jenkins URL

The credentials provided are definitely correct. Using a Token does not work either. I'm using Jenkins 2.7.2.

cliffano commented 8 years ago

Can you provide your node, npm, and nestor versions?

Here's my setup and interactive worked fine.

boruto:nestor cliffano$ node --version
v4.2.4
boruto:nestor cliffano$ npm --version
2.14.12
boruto:nestor cliffano$ nestor --version
0.3.4
boruto:nestor cliffano$ JENKINS_URL=http://localhost:8080 nestor ver
Jenkins ver. 2.7.2
boruto:nestor cliffano$ JENKINS_URL=http://localhost:8080 nestor build temp
Jenkins requires authentication - set username and password in Jenkins URL
boruto:nestor cliffano$ JENKINS_URL=http://localhost:8080 nestor --interactive build temp
prompt: Username:  cliffano
prompt: Password:
Job temp was started successfully
cliffano commented 8 years ago

@doque Would you be able to provide me with node, npm, and nestor versions? I will try to reproduce your problem.

doque commented 8 years ago

Hi,

it seems I'm unable to start jobs only, reading the version works:

➜  ~ env JENKINS_URL=http://192.168.178.230 nestor --interactive ver
prompt: Username:  user
prompt: Password:
Jenkins ver. 2.7.2
➜  ~ env JENKINS_URL=http://192.168.178.230 nestor --interactive build AdminTool
prompt: Username:  user
prompt: Password:
Jenkins requires authentication - set username and password in Jenkins URL

Is there something I should configure in Jenkins?

cliffano commented 8 years ago

Please let me know the output of:

I'll then try to reproduce the error using the exact same versions.

doque commented 8 years ago
➜  ~ node --version
v4.2.6
➜  ~ npm --version
3.10.5
➜  ~ nestor --version
0.3.4

Thank you.

cliffano commented 8 years ago

Sorry, I still can't reproduce the error even with the exact same node, npm, nestor versions (output further below). The other thing you can try is to test it with the latest release of node, npm, and nestor. You can also dive into the code figure out where the interactive user/pass values didn't get passed down.

boruto:tmp cliffano$ node --version v4.2.6 boruto:tmp cliffano$ npm --version 3.10.5 boruto:tmp cliffano$ nestor --version 0.3.4 boruto:tmp cliffano$ JENKINS_URL=http://localhost:8080 nestor ver Jenkins ver. 2.7.2 boruto:tmp cliffano$ JENKINS_URL=http://localhost:8080 nestor --interactive build temp prompt: Username: cliffano prompt: Password: Job temp was started successfully

cliffano commented 8 years ago

Closing this issue for now because it can't be reproduced yet, and need more debugging information. Please re-open when there's more information.