【发布时间】:2021-12-12 18:14:55
【问题描述】:
我正在使用 Keycloak 和 SpringBoot API。 我的目标是能够将 keycloak Admin REST API 与仅生成一次的令牌一起使用。 我已启用服务帐户,但令牌会在几秒钟后过期。 我该怎么做才能生成永不过期的令牌? (例如在 Openshift 服务帐户上)
如果不可能,我如何将我的 springboot 服务连接到 Keycloak 实例? 我是否需要在每次请求之前生成一个令牌??
curl --location --request POST 'http://localhost:8081/auth/realms/api/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=admin-cli' \
--data-urlencode 'client_secret=f8111a95-67dd-412e-9e04-cf044f0e0286'
感谢您提供任何信息
【问题讨论】:
标签: spring-boot keycloak service-accounts keycloak-rest-api