title: redirect_uri contains http instead of https
body: <p>I am developing a Spring web app using Azure OAuth2.</p>
  <p>When I run the app in my localhost, the app is able to sign me in and the redirect uri is &quot;<strong>https</strong>://...../login&quot;. When I uploaded the app on the Azure app service and tried to sign in, I saw that the redirect_uri is &quot;<strong>http</strong>://..../login&quot; instead of <strong>https</strong>.</p>
  <p>I have tried the following properties in application.properties file, but it did not help.</p>
  <pre><code>security.oauth2.client.pre-established-redirect-uri=https://appname.azurewebsites.net/login
  security.oauth2.client.registered-redirect-uri=https://appname.azurewebsites.net/login
  security.oauth2.client.use-current-uri=false
  </code></pre>
  <p>How can I solve this error?</p>
  <h2>Update</h2>
  <p>Setting the above properties will set the correct redirect-uri but the problem is the following:</p>
  <ol>
  <li>I browse &quot;https://mywebapp.azurewebsites.net&quot;</li>
  <li>The page loads with a login button.</li>
  <li>The login button does a sso Oauth2 authentication with Azure AD.</li>
  <li>The first redirect happens on &quot;http://mywebapp.azurewebsites.net/login&quot;. This is the default sso login-path for Spring Oauth2 autoconfigure lib.</li>
  <li>Since the webapp is https only, the http redirection is causing problem. When I manually edit http to https in the browser, the sso authentication is happening fine, but the dashboard page of my webapp again gets redirected to &quot;http://.../dashboard.html&quot; instead of &quot;https://.../dashboard.html&quot;.</li>
  </ol>
  <p>I went through a lot of Stack Overflow posts, it seems that there is a Zuul proxy with Tomcat in Azure app service environment and that proxy is using http. This might be the root-cause of the problem.</p>
  <p>I am stuck with this annoying redirection to http.</p>
  <p>I found a similar issue <a href="https://stackoverflow.com/questions/61187974/azure-ad-integration-in-spring-boot-is-not-redirecting-to-https-when-deployed-in">mentioned here</a>.</p>