[keycloak-user] Keycloak Rest API - sessions

Eivind Larsen eivind at jotta.no
Wed Jun 20 03:27:31 EDT 2018


Hi,
I created issue https://issues.jboss.org/browse/KEYCLOAK-7664 to improve
listing all sessions for a user.


On 19 June 2018 at 17:21:12, Marek Posolda (mposolda at redhat.com) wrote:

I think you're right that usability can be improved. Could you please
create JIRA for this?

Thanks,
Marek

On 18/06/18 15:44, Eivind Larsen wrote:
> Hi Keycloak Users!
>
> I am integrating the session data from Keycloak into our existing
> account settings page.
>
> I see Keycloak has an API call for listing user sessions.
>
> GET /admin/realms/{realm}/clients/{id}/user-sessions
>
> a) I was wondering why this does not include offline sessions?
>
> So to list all sessions I need to:
>
> 1. List user sessions (call above).
> 2. List consents.
> 3. Grab client ids from consents.
> 4. List offlineSessions for each client in 3.
> 5. Merge all the session from 1 and 4.
>
> b) Am I missing something? Is there a simpler way to list all sessions
> for a user?
>
>
> Best regards,
> Eivind Larsen
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user


More information about the keycloak-user mailing list