Skip to content

Instantly share code, notes, and snippets.

@scoheb
Last active April 13, 2018 20:27
Show Gist options
  • Save scoheb/c960a534b592552d96265f03af52f4bf to your computer and use it in GitHub Desktop.
Save scoheb/c960a534b592552d96265f03af52f4bf to your computer and use it in GitHub Desktop.
import hudson.model.User;
import jenkins.security.ApiTokenProperty;
import hudson.util.Secret;
// Get the actual token
u = User.get("system_serviceaccount_rhproduct_jenkins-admin")
tokprop = u.getProperty(ApiTokenProperty.class)
actual_token = tokprop.getApiTokenInsecure()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment