Skip to content

Instantly share code, notes, and snippets.

@ivan-pinatti
Last active June 8, 2021 13:47
Show Gist options
  • Save ivan-pinatti/7d8a877aff42350f16fcb1eb094818d9 to your computer and use it in GitHub Desktop.
Save ivan-pinatti/7d8a877aff42350f16fcb1eb094818d9 to your computer and use it in GitHub Desktop.
Jenkins - Set default crumb issuer via groovy script - #jenkins #groovy
#!groovy
// imports
import jenkins.model.Jenkins
import hudson.security.csrf.DefaultCrumbIssuer
// get Jenkins instance
Jenkins jenkins = Jenkins.getInstance()
// set default crumb issuer
jenkins.setCrumbIssuer(new DefaultCrumbIssuer(true))
// save current Jenkins state to disk
jenkins.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment