OSX Base64 Encoded Credentials

For those who have used the NSX vSphere REST API, you will know that with every API call you are required to send the following in the headers:

So if you have an OSX machine, you can leverage openssl (which is installed by default) to generate the base64 encoded credentials. This means you do not have to find a website and paste credentials into the site to generate the encoded credentials.

The command is as follows

So to generate the credentials for a default username of admin and a password of ‘default’, you would perform the following:
Which will spit out the credentials

Leave a Reply