Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5930

CLI authenticated mode not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • cli
    • None
    • Vista 32bit, JDK 1.6.0_18, Hudson 1.350

      According to Hudson 1.350 changelog:

      • Authentication support in Hudson CLI. (issue 3796)

      it should be possible now to use the CLI when Authorization is set up... but it does not seem to work.

      My setup:

      • Enable security ticked
      • Authorization Matrix-based security
        Anonymous (all denied)
        admin (all allowed)

      I can only login at the Hudson dashboard if I use the admin account.

      But when I try to use the hudson CLI (downloaded the jar file from http://localhost:8080/hudson/cli) I get:
      C:\Work\hudson>java -jar hudson-cli.jar -s http://localhost:8080/hudson help
      Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/hudson/cli
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
      at hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:51)
      at hudson.cli.CLI.<init>(CLI.java:90)
      at hudson.cli.CLI.<init>(CLI.java:62)
      at hudson.cli.CLI.main(CLI.java:171)

      The same happens when I provide the username and password details:
      C:\Work\hudson>java -jar hudson-cli.jar -s http://localhost:8080/hudson help --username admin --password theRightPassword
      Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/hudson/cli
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
      at hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:51)
      at hudson.cli.CLI.<init>(CLI.java:90)
      at hudson.cli.CLI.<init>(CLI.java:62)
      at hudson.cli.CLI.main(CLI.java:171)

      is this the correct way to provide auth credentials via the CLI args?

            Unassigned Unassigned
            abarbieri Andrea Barbieri
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: