最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Keycloak Client Remove UserSession - Stack Overflow

programmeradmin1浏览0评论

I want to remove all the users sessions only for the specify client in Keycloak but I am not finding a way. What I did until now is as below:

List<UserSessionModel> userSessions = session.sessions()
                                             .getUserSessionsStream(realm,client)
                                             .collect(Collectors.toList())
for (UserSessionModel userSession : userSessions) {
    AuthenticatedClientSessionModel clientSession = userSession.getAuthenticatedClientSessionByClient(client.getId());
    userSession.removeAuthenticatedClientSessions(Collections.singleton(client.getId()));

}

How can I fix this?

I am trying to find a solution for this.

发布评论

评论列表(0)

  1. 暂无评论