Class DeviceActivityManager

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

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    attachDevice(org.keycloak.models.UserSessionModel userSession, org.keycloak.models.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.
    static org.keycloak.representations.account.DeviceRepresentation
    getCurrentDevice(org.keycloak.models.UserSessionModel userSession)
    Returns the device information associated with the given userSession.

    Methods inherited from class java.lang.Object

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

    • DeviceActivityManager

      public DeviceActivityManager()
  • Method Details

    • getCurrentDevice

      public static org.keycloak.representations.account.DeviceRepresentation getCurrentDevice(org.keycloak.models.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(org.keycloak.models.UserSessionModel userSession, org.keycloak.models.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