• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • github-oauth-plugin
    • Jenkins 1.599
      github-oauth plugin 0.20

      I'm using the github-oauth plugin for authentication and the Github Commiter Authorization Strategy and I'm unable to use the jenkins-cli with it. Running this command:

      java -jar jenkins-cli.jar -s http://localhost:8080 who-am-i --username <username> --password <jenkins-api-token> 

      results in an error:

      "--username" is not a valid option
      java -jar jenkins-cli.jar who-am-i
      Reports your credential and permissions.
      

      I've also tried ssh key auth with the -i flag but get a similar error about -i being an invalid option.

      Is there another way to use jenkins-cli with github auth?

          [JENKINS-27045] Cannot use jenkins-cli with github oauth plugin

          Eric Heydrick created issue -

          Lloyd Oliver added a comment -

          This seems to be the case when using the google-login-plugin as well, not just limited to the github plugin.

          Lloyd Oliver added a comment - This seems to be the case when using the google-login-plugin as well, not just limited to the github plugin.

          I have a similar issue with --username but -i is working for me with 1.606.

          Joshua Hoblitt added a comment - I have a similar issue with --username but -i is working for me with 1.606.

          Sam Gleske added a comment -

          Jenkins CLI no longer uses --username and --password options. It now only using SSH key authentication. Additionally, github oauth plugin 0.21 now supports using personal access tokens instead of a password for interacting with the Jenkins API. I'm going to close this as resolved.

          Sam Gleske added a comment - Jenkins CLI no longer uses --username and --password options. It now only using SSH key authentication. Additionally, github oauth plugin 0.21 now supports using personal access tokens instead of a password for interacting with the Jenkins API. I'm going to close this as resolved.
          Sam Gleske made changes -
          Assignee Original: Sam Kottler [ skottler ] New: Sam Gleske [ sag47 ]
          Sam Gleske made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Sam Gleske added a comment -

          See wiki documentation on using the personal access token. https://wiki.jenkins-ci.org/display/JENKINS/Github+OAuth+Plugin

          Sam Gleske added a comment - See wiki documentation on using the personal access token. https://wiki.jenkins-ci.org/display/JENKINS/Github+OAuth+Plugin
          Sam Gleske made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Sam Gleske made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Reopened [ 4 ] New: Closed [ 6 ]

          Jens Elkner added a comment -

          Unfortunately this droves me crazy:

          java -jar ~/tmp/jenkins-cli.jar -noKeyAuth help login 
          
          ERROR: You must authenticate to access this Jenkins.
          Use --username/--password/--password-file parameters or login command.
          

          And than

          java -jar ~/tmp/jenkins-cli.jar -noKeyAuth login --username foobar
          
          ERROR: "--username" is not a valid option
          java -jar jenkins-cli.jar login
          Saves the current credential to allow future commands to run without explicit credential information.
          
          
          java -jar ~/tmp/jenkins-cli.jar -noKeyAuth login foobar
          
          ERROR: No argument is allowed: foobar
          java -jar jenkins-cli.jar login
          Saves the current credential to allow future commands to run without explicit credential information.
          

          So it is awefully misleading and one gets stuck because there is no way to find out, how to get it work.

          Jens Elkner added a comment - Unfortunately this droves me crazy: java -jar ~/tmp/jenkins-cli.jar -noKeyAuth help login ERROR: You must authenticate to access this Jenkins. Use --username/--password/--password-file parameters or login command. And than java -jar ~/tmp/jenkins-cli.jar -noKeyAuth login --username foobar ERROR: "--username" is not a valid option java -jar jenkins-cli.jar login Saves the current credential to allow future commands to run without explicit credential information. java -jar ~/tmp/jenkins-cli.jar -noKeyAuth login foobar ERROR: No argument is allowed: foobar java -jar jenkins-cli.jar login Saves the current credential to allow future commands to run without explicit credential information. So it is awefully misleading and one gets stuck because there is no way to find out, how to get it work.
          Jens Elkner made changes -
          Resolution Original: Cannot Reproduce [ 5 ]
          Status Original: Closed [ 6 ] New: Reopened [ 4 ]

            sag47 Sam Gleske
            heydrick Eric Heydrick
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: