jenkinsci / generic-webhook-trigger-plugin

Can receive any HTTP request, extract any values from JSON or XML and trigger a job with those values available as variables. Works with GitHub, GitLab, Bitbucket, Jira and many more.
https://plugins.jenkins.io/generic-webhook-trigger
404 stars 159 forks source link

generic webhook trigger didn't work without specifiying token #234

Closed vaibhav65 closed 1 year ago

vaibhav65 commented 2 years ago

Used when applying webhook at github without token JENKINS_URL/generic-webhook-trigger/invoke

{"jobs":null,"message":"Did not find any jobs with GenericTrigger configured! If you are using a token, you need to pass it like ...trigger/invoke?token=TOKENHERE. If you are not using a token, you need to authenticate like http://user:passsword@jenkins/generic-webhook... "}

When simply pasting url on chrome it works without token

https://:/generic-webhook-trigger/invoke

vaibhav65 commented 2 years ago

version:Jenkins 2.342.So to avoid this error i had to add multiple webhooks at github for multiple repos with multiple tokens

tomasbjerre commented 2 years ago

You are probably logged in when using browser. And that is why it works.

vaibhav65 commented 2 years ago

Ok ,But how i can use it in git hub webhook without token JENKINS_URL=https://IP:port JENKINS_URL/generic-webhook-trigger/invoke

tomasbjerre commented 2 years ago

Sounds like you want to allow anonymous users to trigger jobs. You need to adjust your security settings.

vaibhav65 commented 2 years ago

Thanks i started using token ..But Occasionally token not found for Generic Webhook Trigger Jenkins Plugin when triggered from webhook.

The difference i found is Automatic inclusion of GitSCM plugin in config.xml when tried to configure job

In build trigger i choose generic webhook trigger but jenkins does take automatically GitSCM and create property in job>config.xml file

</org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>

2