无法访问服务器中的Keycloak身份验证

问题描述:

我正在构建一个用keycloak 10.0.2保护的角度应用程序,我已经将其部署在服务器中,当我尝试访问它时,我无法访问Keycloak登录页面,这是我的配置

I'm building an angular application secured with keycloak 10.0.2, i've deployed it in a server, and when i try to access it i can't reach Keycloak login page, here is my configuration

keycloak: {
    keycloakUrl: 'http://servername:8085/auth',
    realm: 'app',
    clientId: 'myapp',
    redirectUri: 'http://servername:8083/myapp'
  }

我应该放置http://localhost:8085/authhttp://servername:8085/auth,还是应该将keycloak中的localhost更改为服务器名,因为keycloak已预先配置为localhost.

Should i put http://localhost:8085/auth or http://servername:8085/auth, or should i change localhost in keycloak to the servername, since keycloak is pre configured to localhost.

我发现我必须启用远程访问并更改standalone.xml,我对其进行了更改,但仍然出现错误:

I found that i have to enable remote access and change standalone.xml, i changed it but i still get the error :

<interface name="management">
        <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
</interface>
<interface name="public">
        <inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>

启动Keycloak时,在日志下方:

And below the log when starting Keycloak :

这应该是一条评论,但我还没有特权"可以这样做.

This should be a comment, but I don't have the 'priveledge' to do that yet.

首先,如果可以提供keycloak服务器的日志,将很有帮助,启动keycloak时,应告诉您它正在监听的地址,请确保它确实是http://0.0.0.0:8085/,尤其是因为8085不是密钥斗篷的默认端口.
如果确实在http://0.0.0.0:8085/上监听,那么我们将需要有关您的网络设置的更多信息,例如:keycloak和您的角度应用程序是否都在同一服务器上运行?您可以在密钥斗篷服务器上使用netstat确认它正在侦听指定端口吗?

First It would be helpful if you could provide the logs of the keycloak server, when you start keycloak it should tell you the address it is listening on, make sure that it really is http://0.0.0.0:8085/, especially since 8085 is not the default port for keycloak.
If it really is listening on http://0.0.0.0:8085/ then we would need more information about your network setup, for example: Are both, keycloak and your angular app, running on the same Server? Can you use netstat on the keycloak server to confirm that it is listening on the specified port?

这里是Keycloak的示例,显示了它的IP和端口,请查找此行

Here is an example of Keycloak showing it's IP and port, look for this line