Posts Tagged base64

How to create manually string for basic http authentication

If you need to test Basic authentication, you can manually add header like this into HTTP request:

Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

The line after Basic is formed from your username and password the following way in Mac or Linux command line:

echo -n "username:password"  | openssl base64 -base64

On the other hand, you can use “curl” directly from command line to call the request with basic authentication, use the following command (it is GET in the example below):

curl --user username:password https://your_webservice_here

, , , ,

1 Comment