Friday, July 1, 2016

Generate Basic Athentication in command line

Using Curl
$ curl -vv --user myusername:mypassword http://www.google.com 2>&1 | grep Authorization


Using GNU base64
Encode

$ printf "thiago:masaki" | base64

> dGhpYWdvOm1hc2FraQ==

Decode

$ printf "dGhpYWdvOm1hc2FraQ==" | base64 -d

> thiago:masaki

No comments:

Blog Archive