Class DeviceActivityManager

    • Constructor Detail

      • DeviceActivityManager

        public DeviceActivityManager()
    • Method Detail

      • 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