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

ComputedFolder shows BuildAuthorizationToken configuration but does not actually support it

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Trying to use the "Trigger builds remotely (e.g., from scripts)" Build Trigger from a multibranch pipeline project doesn't seem to work.

      If I check off the box and type in a token and click save, the job saves successfully but it does not write an authToken element to the job config and the item is unchecked in the configuration when I reload the page. Even manually setting an authToken and POSTing the config doesn't work. While the element is there in the config, I'm not able to kick a job off with the token.

      I can post some screenshots and config snippets if that will be helpful, but this seems to be reproducible easily enough that it might be overkill.

      I've been able to reproduce this with a fresh Jenkins 2.x install as well.

      Repro case

      Given: A Jenkins 1.651.2 instance with some kind of security enabled (e.g. anonymous users cannot build jobs). And the pipeline plugins installed.

      1. Create a freestyle or single pipeline job.
      2. Under "Build Triggers," select "Trigger builds remotely (e.g., from scripts)"
      3. Enter "hello" in the "Authentication Token" field
      4. Save the job.
      5. POST to jobUrl/build?token=hello (e.g. curl -XPOST http://172.17.0.2:8080/job/freestyle/build?token=hello)
      6. Observe the job is triggered.
      7. Create a multibranch pipeline job.
      8. Add an authentication token as above.
      9. Save the job.
      10. POST to jobUrl/build?token=hello (e.g. curl -XPOST http://172.17.0.2:8080/job/multibranch/build?token=hello)
      11. Observe you receive an "Authentication required" error.
      12. Go back to the job configuration and observe the Build Trigger isn't enabled.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Neither could I find an alternative for this webhook when using the GitHub plugin.

            You need to install the github-branch-source plugin, which interprets GitHub webhooks.

            Show
            jglick Jesse Glick added a comment - Neither could I find an alternative for this webhook when using the GitHub plugin. You need to install the github-branch-source plugin, which interprets GitHub webhooks.
            Hide
            dnfehren Daniel Fehrenbach added a comment -

            Truc Nguyen thanks for the tip - was that basic_user:basic_password pair based on a Jenkins credentials object or something else?

            Show
            dnfehren Daniel Fehrenbach added a comment - Truc Nguyen thanks for the tip - was that basic_user:basic_password pair based on a Jenkins credentials object or something else?
            Hide
            tzafrir11 tzafrir added a comment - - edited

            This should be done with the webhook for the Git plugin, /git/notifyCommit.

            Jesse Glick I ended up doing just that and it works fine without requiring special permission. Yet post message to this address (as what gilab webhook provides) result with "no valid crumb was included in the request"

            Show
            tzafrir11 tzafrir added a comment - - edited This should be done with the webhook for the Git plugin, /git/notifyCommit. Jesse Glick I ended up doing just that and it works fine without requiring special permission. Yet post message to this address (as what gilab webhook provides) result with "no valid crumb was included in the request"
            Hide
            jglick Jesse Glick added a comment -

            Yet post message to this address (as what gilab webhook provides) result with "no valid crumb was included in the request"

            File an RFE for git-plugin.

            Show
            jglick Jesse Glick added a comment - Yet post message to this address (as what gilab webhook provides) result with "no valid crumb was included in the request" File an RFE for git-plugin .
            Hide
            jglick Jesse Glick added a comment -

            (a CrumbExclusion specifically)

            Show
            jglick Jesse Glick added a comment - (a CrumbExclusion specifically)

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                nmaclennan Norm MacLennan
              • Votes:
                19 Vote for this issue
                Watchers:
                38 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: