Uploaded image for project: 'Red Hat build of Keycloak'
  1. Red Hat build of Keycloak
  2. RHBK-3001

Redirects to admin endpoint 404s on hostname-admin / request scheme mismatch [GHI#39085]

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Before reporting an issue

      [x] I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

      Area

      core

      Describe the bug

      When a https url is configured for hostname-admin and requests are http (e.g. from a edge proxy server terminating TLS) requests to /admin/ return a 404.

      This was introduced with https://github.com/keycloak/keycloak/issues/38463. The logic comparing requestUrl and adminUrl should be relaxed.

      Version

      26.2.0

      Regression

      [x] The issue is a regression

      Expected behavior

      Redirect to Admin Console is performed when /admin is accessed via the Admin Hostname - a mismatch in schemes http/https should be allowed.

      Actual behavior

      404 response when request is http, and hostname-admin is https.

      How to Reproduce?

      I'm seeing the issue with only the hostname configured - maybe this is internally setting admin to hostname + "/admin"?

      ./bin/kc.sh start-dev \
      --hostname=https://banana.russdev
      

      Access /admin/ with a host header configured - and on http. Observe a 404.

      $ curl -v --header 'Host: banana.russdev'  localhost:8080/admin/
      < HTTP/1.1 404 Not Found
      

      Anything else?

      No response

              Unassigned Unassigned
              pvlha Pavel Vlha
              Keycloak Core (shared)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: