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

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Mar 27 12:35:54 EDT 2010



Gonzalo Paniagua Javier <gonzalo at novell.com> changed:

           What    |Removed                     |Added
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Gonzalo Paniagua Javier <gonzalo at novell.com> 2010-03-27 16:35:53 UTC ---
This is now fixed in trunk and the mono-2-4 and mono-2-6 branches.
It failed on Mono because when you set PreAuthenticate to 'true' we were
removing any existing 'Authorization' header.

If you can't get Mono from sources, a workaround is to remove the
'req.PreAuthenticate' line in your original code (btw, that line is of no use
unless you also set req.Credentials).

Also, I think the best way of doing what you want is to do is:
          var req = WebRequest                   
          req.Method = "GET";
          req.PreAuthenticate = true;
          req.Credentials = new NetworkCredential ("user", "password");
          var stream = req.GetResponse().GetResponseStream();

and you don't need to worry about anything else. The above code works with MS
and Mono without the patch that fixes this bug.


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

More information about the mono-bugs mailing list