title: Microsoft Identity Web generating http instead of https for redirect_url
body: <p>I have an ASP.NET Core MVC app and I want to use Azure B2C authentication.</p>
  <p>The redirect_url that's being generated has <code>http</code> instead of <code>https</code> like so:</p>
  <pre><code>&amp;redirect_uri=**http**%3A%2F%2Fmyapp.com%2Fsignin-oidc
  </code></pre>
  <p>This should be <code>https</code>, and it's causing this error:</p>
  <blockquote>
  <p>AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: '9dbe40e0-7555-4ddf-9c17-b5218ed6ca89'.</p>
  </blockquote>
  <p>My <code>appsettings.json</code> looks like this:</p>
  <pre><code>&quot;AzureAdB2C&quot;: {
      &quot;Instance&quot;: &quot;https://login.microsoftonline.com/&quot;,
      &quot;Domain&quot;: &quot;xxx&quot;,
      &quot;ClientId&quot;: &quot;xxxx&quot;,
      &quot;TenantId&quot;: &quot;xxxx&quot;,
      &quot;ClientSecret&quot;: &quot;xxxx&quot;,
      &quot;CallbackPath&quot;: &quot;/signin-oidc&quot;,
      &quot;SignedOutCallbackPath &quot;: &quot;/&quot;
  }
  </code></pre>
  <p>and my code in <code>Startup.cs</code> is like so:</p>
  <pre><code>services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
              .AddMicrosoftIdentityWebApp(Configuration, &quot;AzureAdB2C&quot;);
  </code></pre>
  <p>For some reason this works fine on my dev machine with localhost (redirect_url=https) but on the server it's always <code>http</code>.</p>
  <p>Any ideas? This has been driving me crazy all day</p>
  <p><strong>EDIT: RESOLVED!</strong>  Turns out the issue was that I didn't have a HTTPS binding in IIS, only a HTTP binding...  strange, since I was accessing the site via https://... - I guess somehow the IIS gave a certificate and allowed HTTPS even though I didn't have a binding for it</p>