keycloak redirect behind reverse proxy

后端 未结 1 1143
攒了一身酷
攒了一身酷 2021-01-28 03:36

I am trying to get keycloak to run behind a kong ingress in kubernetes. The issue I am having is keycloak is adding a port it thinks it is on to the urls it is returning. reques

1条回答
  •  清酒与你
    2021-01-28 04:19

    There is hostname SPI which allows you to set hostname and port for Keycloak instead of retrieving them from HTTP request. You can set ports to default ones (80/443) and resulting URLs will not have a port displayed.

    # Replace `request` provider with `fixed`
    /subsystem=keycloak-server/spi=hostname:write-attribute(name=default-provider,value=fixed)
    # Set hostname and ports for http and https
    /subsystem=keycloak-server/spi=hostname/provider=fixed:write-attribute(name=properties.hostname,value=example.org)
    /subsystem=keycloak-server/spi=hostname/provider=fixed:write-attribute(name=properties.httpsPort,value=443)
    /subsystem=keycloak-server/spi=hostname/provider=fixed:write-attribute(name=properties.httpPort,value=80)
    

    These values are not runtime configurable thus you have to restart Keycloak after the changes.

    0 讨论(0)
提交回复
热议问题