Class DeviceActivityManager

java.lang.Object
org.keycloak.device.DeviceActivityManager

public class DeviceActivityManager extends Object
Author:
Pedro Igor
  • Constructor Details

    • DeviceActivityManager

      public DeviceActivityManager()
  • Method Details

    • getCurrentDevice

      public static DeviceRepresentation getCurrentDevice(UserSessionModel userSession)
      Returns the device information associated with the given userSession.
      Parameters:
      userSession - the userSession
      Returns:
      the device information or null if no device is attached to the user session
    • attachDevice

      public static void attachDevice(UserSessionModel userSession, KeycloakSession session)
      Attaches a device to the given userSession where the device information is obtained from the HttpHeaders.USER_AGENT in the current request, if available.
      Parameters:
      userSession - the user session
      session - the keycloak session