Class SessionResource

java.lang.Object
org.keycloak.services.resources.account.SessionResource

public class SessionResource extends Object
Author:
Pedro Igor
  • Constructor Summary

    Constructors
    Constructor
    Description
    SessionResource(org.keycloak.models.KeycloakSession session, Auth auth, org.keycloak.events.EventBuilder event)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Collection<org.keycloak.representations.account.DeviceRepresentation>
    Get device activity information based on the active sessions.
    jakarta.ws.rs.core.Response
    logout(boolean removeCurrent)
    Remove sessions
    jakarta.ws.rs.core.Response
    Remove a specific session
    Stream<org.keycloak.representations.account.SessionRepresentation>
    Get session information.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SessionResource

      public SessionResource(org.keycloak.models.KeycloakSession session, Auth auth, org.keycloak.events.EventBuilder event)
  • Method Details

    • toRepresentation

      @GET @Produces("application/json") public Stream<org.keycloak.representations.account.SessionRepresentation> toRepresentation()
      Get session information.
      Returns:
    • devices

      @Path("devices") @GET @Produces("application/json") public Collection<org.keycloak.representations.account.DeviceRepresentation> devices()
      Get device activity information based on the active sessions.
      Returns:
    • logout

      @DELETE @Produces("application/json") public jakarta.ws.rs.core.Response logout(@QueryParam("current") boolean removeCurrent)
      Remove sessions
      Parameters:
      removeCurrent - remove current session (default is false)
      Returns:
    • logout

      @Path("/{id}") @DELETE @Produces("application/json") public jakarta.ws.rs.core.Response logout(@PathParam("id") String id)
      Remove a specific session
      Parameters:
      id - a specific session to remove
      Returns: