I'm using Jenkins with DC/OS (Mesos) and the service doesn't have a standard login but instead uses Mesos/Zookeeper for authentication. I'm can access JENKINS_HOME and have the config files for each user. I see the config.xml and also see the secret.key. I found this code:
https://github.com/abrindeyev/jenkins-helpers/blob/master/bin/get_api_token.rb
whose purpose is to decode the Jenkins API Token from the config. However, when I run this I get the following error:
/root/decrypt_api.rb:28:in `final': wrong final block length (OpenSSL::Cipher::CipherError)
from /root/decrypt_api.rb:28:in `decrypt'
from /root/decrypt_api.rb:35:in `<main>'
Here's an example Token and Key (from a Docker Jenkins test container):
Cipher in config.xml:
<jenkins.security.ApiTokenProperty>
<apiToken>{AQAAABAAAAAwrkIhJkGOx+QkqgJ/Ep8NhecxeWcqAs78RI9v5kr8y1FSCJBA4YFHrneQGxmetsj3/xSywFRXItIbtuCufWR6ng==}</apiToken>
</jenkins.security.ApiTokenProperty>
Secret Key:
bdafc86eae946c35ca57d3af02a82b733741d59e1eca44e0a3f7ef0b8f25f8e6
How can I decode the Token with the cipher and the key?