Bug 26601 - SupportsPreAuthenticate returns true on iOS.
Summary: SupportsPreAuthenticate returns true on iOS.
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.6.0
Hardware: PC Windows
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-30 11:22 UTC by Alexandre Chohfi
Modified: 2016-07-05 12:29 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test project. (6.54 MB, application/x-zip-compressed)
2015-02-02 10:26 UTC, Alexandre Chohfi
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Alexandre Chohfi 2015-01-30 11:22:05 UTC
I'm using SignalR.

Internally, they use Microsoft HTTP Client Libraries (I'm using the latest version, 2.2.28).

SignalR uses this library for many things, but I've found a bug on the extension method SupportsPreAuthenticate of the class System.Net.Http.HttpClientHandlerExtensions.

This method should return false on iOS, but still, it is returning true, causing something like this:
if(SupportsPreAuthenticate())
{
	PreAuthenticate = true;
}
To throw an exception, when it shouldn't.
Comment 1 Miguel de Icaza [MSFT] 2015-01-30 18:29:23 UTC
Can you please share your solution?
Comment 2 Sebastien Pouliot 2015-01-31 12:01:03 UTC
`System.Net.Http.HttpClientHandlerExtensions` is not a type in the `System.Net.Http.dll` that ships with XI. It might be the MS version that somehow getting copied into the build. The test case will be very helpful to track this :)
Comment 3 Alexandre Chohfi 2015-02-02 10:26:35 UTC
Created attachment 9598 [details]
Test project.

Tested on iOS Simulator 7.1 (iPhone 4s).
Comment 4 Sebastien Pouliot 2016-07-05 12:29:11 UTC
Calling (or not)

> PreAuthenticate = true;

does not change anything in recent versions of Xamarin.iOS.

However the attached test case uses `Microsoft.Net.Http` nuget package which provides it's own `System.Net.Http.dll` assembly, i.e. it does not use the one provided by the Xamarin's SDK, so YMMV.

You should use a PCL profile that allows System.Net.Http.dll without the use of this nuget and you'll get properties that will match the capabilities (and also support for native handlers).