在openshift中使用keycloak和spring读取所有

在openshift中使用keycloak和spring读取所有

本文介绍了如何在openshift中使用keycloak和spring读取所有用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里,我正在尝试从keycloak获取用户列表.它可以与docker compose一起使用,但不能在openshift中使用?!

here i am trying to get a list with users from keycloak.it works withe docker compose, but not in openshift?!

我的application.property

my application.property

keycloak.enabled=true
keycloak.realm=somname
keycloak.ssl-required=none
keycloak.resource=someapp
keycloak.public-client=true

keycloak.auth-server-url=${KEYCLOAK_AUTH-SERVER-URL:https://localhost/auth}
keycloak.disable-trust-manager=true

app.connectors.KeyCloakAdminConnector.serverUri=${KEYCLOAK_ADMIN-URL:http://idm.local:8081/auth}
app.connectors.KeyCloakAdminConnector.realm=${keycloak.realm}
app.connectors.KeyCloakAdminConnector.username=admin
app.connectors.KeyCloakAdminConnector.password=pass
app.connectors.KeyCloakAdminConnector.clientId=${keycloak.resource}

推荐答案

作为解决方案,我更改了:

As a solution i changed the:

 keycloak-admin-url: 'my-keycloak-route/auth'

在application.property中

in application.property to

keycloak-admin-url: 'http://myservice-keycloak-http:8080/auth'

所以我将Spring boot App和Keycloack之间的连接从Rout-Object更改为Service-Object.

so i change the connection between the Spring boot App and Keycloack from Rout-Object to a Service-Object.

它可以工作,因为服务不是https.所以我不需要在Spring boot App中向JVM keytrust提供证书

its works because Service is not https. so i dont need to provide a certificate to JVM keytrust in the Spring boot App

这篇关于如何在openshift中使用keycloak和spring读取所有用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 19:01