Forked from hoto/decrypt-jenkins-credentials.groovy
Created
November 11, 2025 11:36
-
-
Save JeffreyShran/f3d147cc97b1d6caa1393cdb7fa66b70 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // https://myjenkins.com/script | |
| hashed_pw='{AQAAABAAAAAQB68ttY8Fp7wpTtF/d8VPl8ZU5PZEIJbofSrTgZXxbdY=}' | |
| passwd = hudson.util.Secret.decrypt(hashed_pw) | |
| println(passwd) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials.class,
Jenkins.instance,
null,
null
)
creds.each { println("Credentials class: " + it.class) }
println()
for(c in creds) {
if(c instanceof com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey){
println(String.format("id=%s desc=%s key=%s", c.id, c.description, c.privateKeySource.getPrivateKeys()))
}
if (c instanceof com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl){
println(String.format("id=%s desc=%s user=%s pass=%s", c.id, c.description, c.username, c.password))
}
}