[Mono-bugs] [Bug 591633] New: Basic WebAuth fails.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Mar 27 00:24:07 EDT 2010



           Summary: Basic WebAuth fails.
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.6.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: abe.gillespie at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-US)
AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.7 Safari/533.2

Try this test case.  I believe the headers get dropped:

using System;
using System.Net;
using System.IO;
using System.Text;

namespace Tester
    class Program
        static void Main(string[] args)
                var req = WebRequest
                req.Method = "GET";
                req.PreAuthenticate = true;
                req.Headers["Authorization"] =
                    ToBasicAuthorizationHeader("twitter-user", "password");
                var stream = req.GetResponse().GetResponseStream();

                Console.WriteLine("Windows: WIN");
                Console.WriteLine("Mono: FAIL");

        public static string ToBasicAuthorizationHeader(
            string username, string password)
            var bytes = Encoding.ASCII.GetBytes(
                string.Format("{0}:{1}", username, password));
            var token = Convert.ToBase64String(bytes);
            return string.Format("Basic {0}", token);

Reproducible: Always

Steps to Reproduce:
Run the test case.
Actual Results:  
Fails with Unauthorized exception.

Expected Results:  

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list