How to do IP restrictation for clients in keycloak admin console

女生的网名这么多〃 提交于 2020-07-23 07:39:11

问题


I defined a client in keycloak admin console to authorize it with client_credentials flow to call server-to-server api in my application. Everything is fine, i want to apply IP restriction for that client.

Where can i define this restriction in admin console? i didn't find such configuration in keycloak documentation.


回答1:


There is no such settings out of the box, but you could try to implement custom client authenticator. So for example allowed IP Addr could be stored in client attributes, and your authenticator implementation will challenge incoming request against specified IP addr. See "Server Development" section in Keycloak documentation. Also you can refer to keycloak github repo for implementation examples and guides. Start from

https://github.com/keycloak/keycloak/blob/master/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java



来源:https://stackoverflow.com/questions/62979133/how-to-do-ip-restrictation-for-clients-in-keycloak-admin-console

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