title: Xamarin iOS OidcClient requires HTTPS (possible by App Transport Security)
body: <p>I'm trying to connect to an IdentityServer (V4) without SSL but that occurs a crash on my Xamarin iOS Application.</p>
  
  <p>Code:</p>
  
  <pre><code>OidcClient _client;
  AuthorizeState _state;
  SafariServices.SFAuthenticationSession _session;
  
  public ViewController(IntPtr handle) : base(handle)
  {
  
      var options = new OidcClientOptions
      {
          Authority = "http://auth.xxxx.be",
          ClientId = "iosClient",
  
          Scope = "openid email xxx",
          RedirectUri = "xxxApp://callback",
  
          ResponseMode = OidcClientOptions.AuthorizeResponseMode.Redirect,
  
      };
  
      _client = new OidcClient(options);
  
  }
  </code></pre>
  
  <p>When the code is executed, i get the following error:</p>
  
  <pre><code>Error loading discovery document: Error connecting to 
  http://auth.xxxx.be/.well-known/openid-configuration: HTTPS required
  </code></pre>
  
  <p>I tried to allow non-https requests with the following lines</p>
  
  <pre><code>    &lt;plist version="1.0"&gt;
      &lt;dict&gt;
       ...
      &lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
      &lt;dict&gt;
        &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;
      &lt;false/&gt;
    &lt;/dict&gt;
  &lt;/dict&gt;
      &lt;/plist&gt;
  </code></pre>
  
  <p>But this has no effect. Possibly because the OidcClient used his own methods to connect to this web application. </p>
  
  <p>Offcourse with SSL, this is not a problem but I want to save some costs to run my website on Azure (= higher cost for SSL support). </p>
  
  <p>I'm running the latest Xamarin/Visual Studio with iOS 11.</p>