Last active
May 22, 2018 02:56
-
-
Save mlsaito/066395877ebde9491bcc08a7b5838202 to your computer and use it in GitHub Desktop.
Convert strings to Base64 encoding in MacOS using OpenSS
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
| Encoding to Base64: | |
| $ echo '[email protected]:samplePassword' | openssl base64 | |
| > bWFrb0ByaW5nY2FwdGNoYS5jb206c2FtcGxlUGFzc3dvcmQK | |
| Decoding from Base64: | |
| $ echo 'bWFrb0ByaW5nY2FwdGNoYS5jb206c2FtcGxlUGFzc3dvcmQK' | openssl base64 -d | |
| > [email protected]:samplePassword |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Helpful for converting account credentials to Base64 for Basic HTTP Header when making HTTP requests.
curl -H "Basic: bWFrb0ByaW5nY2FwdGNoYS5jb206c2FtcGxlUGFzc3dvcmQK" https://someApi.com/getData?id=523Or you could simply just do:
curl --user "[email protected]:samplePassword" https://someApi.com/getData?id=523