FubarDevelopment / restsharp.portable

Some kind of a RestSharp port to PCL
BSD 2-Clause "Simplified" License
96 stars 33 forks source link

HttpBasicAuthenticator does not support pre-authenticate #55

Closed dermeister0 closed 8 years ago

dermeister0 commented 8 years ago

HttpBasicAuthenticator fills token after challenge handling only. However, my server does not return appropriate WWW-Authenticate header.

I added following constructor for myself:

        public HttpBasicAuthenticator(string username, string password)
        {
            _authToken = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{username}:{password}"));
        }

Similar constructor presents in RestSharp: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Authenticators/HttpBasicAuthenticator.cs

fubar-coder commented 8 years ago

Fixed in 3.1.2