I hadn’t thought to check in that direction. But you are correct.
BASE64 encoding what is in the database matches what is displayed in the web UI.
Thank you for the help.
I hadn’t thought to check in that direction. But you are correct.
BASE64 encoding what is in the database matches what is displayed in the web UI.
Thank you for the help.
Currently I am running FOG version 1.5.8
I am trying to find a way to pull the global and user API tokens during/after the install of FOG.
I have pulled the MYSQL username and password from /opt/fog/.fogsettings, and I queried the FOG database for both API keys, but the keys stored in the database are different than what the web interface.
SELECT uAPIToken FROM users;
SELECT settingValue FROM globalSettings WHERE settingKey='FOG_API_TOKEN';
I tried digging through some of the code, and there were a couple of spots that was referring to BASE64 encoding, but even BASE64 decoding of the values in the DB did not work.
Is there a way to find working API tokens through a scripting process?
Querying a database, decoding, or even using Basic Auth and pulling them from the web interface?
My use case for this is so that I can automatically create images and hosts from an external database. I am auto generating a FOG image using packer and vmware, and then assigning that image to hosts that are populated from another database that manages our machines. My goal is to fully automate the building, and deployment of FOG, and then capturing images, and auto adding hosts. The API tokens are my last major stumbling block.