In Control Panel, click Programs and Features, and then click Turn Windows features on or off. Expand Internet Information Services, expand World Wide Web Services, expand Security, and then select Basic Authentication. Click OK. Click Close.
Creating a Basic Authentication RequestSelect the Composer tab. Set the HTTP/HTTPS method to GET and add the URL in the URL field. Create an object in the request Body and the user and passwd variables and their values. In this object, user and passwd are the predefined variables for the Basic Authentication.
To send basic auth credentials with Curl, use the "-u login: password" command-line option. Curl automatically converts the login: password pair into a Base64-encoded string and adds the "Authorization: Basic [token]" header to the request.
Easy. In order to add a basic authentication to your HttpRequest you do this:
string username = "Your username";
string password = "Your password";
string svcCredentials = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(username + ":" + password));
request.Headers.Add("Authorization", "Basic " + svcCredentials);
In basic authentication you need to use Base64 to encode the credentials.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With