title: Azure AD redirect URI changes from https to http
body: <h2>Overview</h2>
  <p>I have an app registered at Azure AD portal. The redirect mechanism has been working great in development, but there is a strange conversion going on Oauth redirect URIs.</p>
  <p>Client application is built with Django framework and using MSAL for Python library.</p>
  <h2>Problem specifically</h2>
  <p>Suppose I have redirect URI specified as follows in the Azure AD app registration: <code>https://myapp.com/auth/redirect</code></p>
  <p>I get an error <code>AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: '&lt;application ID&gt;'</code></p>
  <p>Diving into the requests sent, I can see, that the redirect URI gets somehow manipulated somewhere in the process.<br />
  (<em>Note the conversion from <strong>https -&gt; http</strong></em>)<br />
  <code>...redirect_uri=http%3A%2F%2Fmyapp.com%2Fauth%2Fredirect&amp;scope=User.Read.basic....</code></p>
  <p>But the Azure AD actually doesn't even accept URL's with plain http.</p>
  <p>I have tried to produce the same error with just localhost, (since localhost URL is exception to the rule, that only https URL's are allowed) and with redirect URL <code>http://localhost:8000/auth/redirect</code> the authentication process works and with <code>https://localhost:8000/auth/redirect</code> it produces the same result described above.</p>