Couldn't access Keycloak authentification in a server

ε祈祈猫儿з 提交于 2021-02-08 09:05:47

问题


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'
  }

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.

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>

And below the log when starting Keycloak :


回答1:


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

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?

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



来源:https://stackoverflow.com/questions/63869742/couldnt-access-keycloak-authentification-in-a-server

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