启用对 Keycloak 的远程访问

Enabling remote access to Keycloak

我正在使用 Keycloak 授权服务器来管理我的应用程序权限。但是,我发现独立服务器只能在本地访问。

http://localhost:8080/auth 有效,但 http://myhostname:8080/auth 无效。此问题不允许从内部网络访问服务器。

独立的 Keycloak 服务器在 JBoss Wildfly 实例的顶部运行,出于安​​全原因,默认情况下该服务器不允许从外部访问它(它应该只用于管理控制台,但似乎在 Keycloak 的情况下影响每个 url)。它必须使用 -b=0.0.0.0 选项启动才能启用它。

However, if your Wildfly is running on a remote machine and you try to access your administrative page through the network by it’s IP address or hostname, let’s say, at http://54.94.240.170:8080/, you will probably see a graceful This webpage is not available error, in another words, Wildfly said “No, thanks, I’m not allowing requests from another guys than the ones at my local machine”.

另请参阅:

您可以使用此命令启动 keycloak 服务器

standalone.bat -b 0.0.0.0

对于现在路过这里的任何人,我在 Keycloak 8 的文档中找到了这个:

Users can interact with Keycloak without SSL so long as they stick to private IP addresses like localhost, 127.0.0.1, 10.0.x.x, 192.168.x.x, and 172.16.x.x. If you try to access Keycloak without SSL from a non-private IP address you will get an error.

这是从管理控制台禁用它的方法,只需单击您的领域,然后选择上述选项。

注意:不要忘记以下内容 standalone.bat-b 0.0.0.0