title: Keycloak Redirect URI is adding port zero to the url
body: <p>Encountered redirect_uri error in keycloak. Found same issue logged at JIRA <a href="https://issues.jboss.org/browse/KEYCLOAK-7237" rel="noreferrer">KEYCLOAK-7237</a>, just want to check any work around? Anyone can help? Thank you in advance.</p>
  
  <p>2018-06-30 11:34:13,996 WARN  [org.keycloak.events] (default task-8) type=LOGIN_ERROR, realmId=Victz, clientId=portal, userId=null, ipAddress=, error=invalid_redirect_uri, redirect_uri=<a href="https://www.example.com:0/home" rel="noreferrer">https://www.example.com:0/home</a></p>
  
  <p>I am using apache http reverse proxy running on centos7, wildly 10, keycloak 3.4.3. has also tried in below environment but same error.</p>
  
  <p>Tried in 
  wildly 10, wildly 11, jboss 7.1,
  Keycloak 3.4.3 as well as keycloak 4.0</p>
  
  <p>Also tried shutdown apache http and access directly to <a href="http://www.example.org:8080/home" rel="noreferrer">http://www.example.org:8080/home</a> , but seems return_uri automatically been converted to https with port 0. </p>
  
  <p>Please see below standalone.xml, tried removed below proxy-peer and request-dumper config but no luck. </p>
  
  <pre><code>    &lt;subsystem xmlns="urn:jboss:domain:undertow:4.0"&gt;
          &lt;buffer-cache name="default"/&gt;
          &lt;server name="default-server"&gt;
              &lt;http-listener name="default" socket-binding="http" proxy-address-forwarding="true" enable-http2="true"/&gt;
              &lt;https-listener name="https" socket-binding="https" proxy-address-forwarding="true" security-realm="ApplicationRealm" enable-http2="true"/&gt;
              &lt;host name="default-host" alias="localhost"&gt;
                  &lt;location name="/" handler="welcome-content"/&gt;
                  &lt;location name="/drive" handler="drive"/&gt;
                  &lt;access-log pattern="%h %l %u %t &amp;quot;%r&amp;quot; %s %b &amp;quot;%{i,Referer}&amp;quot; &amp;quot;%{i,User-Agent}&amp;quot; &amp;quot;%{i,COOKIE}&amp;quot; &amp;quot;%{o,SET-COOKIE}&amp;quot; %S &amp;quot;%I %T&amp;quot;" prefix="access."/&gt;
                  &lt;filter-ref name="server-header"/&gt;
                  &lt;filter-ref name="x-powered-by-header"/&gt;
                  &lt;http-invoker security-realm="ApplicationRealm"/&gt;
              &lt;/host&gt;
              &lt;host name="example1" alias="example.com1,www.example.com1" default-web-module=“example1-0.1.war"&gt;
                  &lt;location name="/drive" handler="drive”/&gt;
                  &lt;filter-ref name="proxy-peer"/&gt;
                  &lt;filter-ref name="request-dumper" priority="30"/&gt;
              &lt;/host&gt;
              &lt;host name="example2" alias="example.com2,www.example.com2" default-web-module="example2-0.1.war"&gt;
                  &lt;location name="/drive" handler="drive"/&gt;
                  &lt;filter-ref name="proxy-peer"/&gt;
                  &lt;filter-ref name="request-dumper" priority="30"/&gt;
              &lt;/host&gt;
              &lt;host name="example3" alias="example.com3,www.example.com3" default-web-module="example3-0.1.war"&gt;
                  &lt;location name="/drive" handler="drive"/&gt;
                  &lt;filter-ref name="proxy-peer"/&gt;
                  &lt;filter-ref name="request-dumper" priority="30"/&gt;
              &lt;/host&gt;
  
          &lt;/server&gt;
          &lt;servlet-container name="default"&gt;
              &lt;jsp-config/&gt;
              &lt;websockets/&gt;
          &lt;/servlet-container&gt;
          &lt;handlers&gt;
              &lt;file name="welcome-content" path="${jboss.home.dir}/welcome-content"/&gt;
              &lt;file name="drive" path="/app/drive"/&gt;
          &lt;/handlers&gt;
          &lt;filters&gt;
              &lt;response-header name="server-header" header-name="Server" header-value="JBoss-EAP/7"/&gt;
              &lt;response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/&gt;
              &lt;filter name="proxy-peer" class-name="io.undertow.server.handlers.ProxyPeerAddressHandler" module="io.undertow.core"/&gt;
              &lt;filter name="request-dumper" class-name="io.undertow.server.handlers.RequestDumpingHandler" module="io.undertow.core"/&gt;
          &lt;/filters&gt;
      &lt;/subsystem&gt;
  </code></pre>