Last active
June 8, 2021 13:47
-
-
Save ivan-pinatti/7d8a877aff42350f16fcb1eb094818d9 to your computer and use it in GitHub Desktop.
Jenkins - Set default crumb issuer via groovy script - #jenkins #groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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