Keycloak设置http代理proxy

来自三线的随记
Admin讨论 | 贡献2022年2月10日 (四) 15:39的版本
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

为keycloak发起的访问请求设置http代理(Proxy settings for keycloak outgoing requests)

Official document

https://www.keycloak.org/docs/latest/server_installation/#_proxymappings

Related configuration file path

There are some things you’ll need to configure in standalone.xml, standalone-ha.xml, or domain.xml. The location of this file depends on your operating mode.

/opt/jboss/keycloak/standalone/configuration/****

eg: /opt/jboss/keycloak/standalone/configuration/standalone-ha.xml

<spi name="connectionsHttpClient">
    <provider name="default" enabled="true">
        <properties>
           <property name="proxy-mappings" value="[&quot;.*\\.(microsoft|microsoftonline)\\.com;http://your-proxy-address.net:8080&quot;]"/>
        </properties>
    </provider>
</spi>

ps

需要注意的是 &quot; 是 " 的实体字符

Note that one needs to encode " characters with &quot;.