Configuring IIS as reverse-proxy for Keycloak

拈花ヽ惹草 提交于 2019-12-12 13:20:34

问题


I'm using Keycloak 2.3.0 version, standalone mode, server. I configured IIS URL Rewrite for local Keycloak server running on localhost:8080.

The problem is that there is no way to specify base url in Keycloak, instead Keycloak tries to detect its own host/port and always appends port number (8080) to redirects. I fixed everything except 'auth-server-url' in config json. Is there any way to get it working?


回答1:


I've been running Keycloak behind a reverse-proxy for some time. The key is:

  • to have it configured properly in standalone.xml - HTTPS proxy settings for mydomain.com/sso settings follow:

    • <http-listener name="default"... -> <http-listener name="default" socket-binding="http" proxy-address-forwarding="true" redirect-socket="proxy-https"/>
    • <socket-binding name="http"... -> <socket-binding name="proxy-https" port="443"/>
    • <web-context>auth... -> <web-context>sso</web-context>
  • to run it on the same context path as the proxy is. Eg. mydomain.com/keycloak -> localhost:8080/keycloak

  • to access Keycloak admin console from the non-local address for the first time - it generates some of its settings based on this first access


来源:https://stackoverflow.com/questions/40388028/configuring-iis-as-reverse-proxy-for-keycloak

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!