java - Keycloak Client Remove UserSession - Stack Overflow

I want to remove all the users sessions only for the specify client in Keycloak but I am not finding a

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745573789a4633840.html

相关推荐

  • java - Keycloak Client Remove UserSession - Stack Overflow

    I want to remove all the users sessions only for the specify client in Keycloak but I am not finding a

    19小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信