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. How to use basic authentication on GAE with PHP | Bykov TechnoBlog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: