Interface TrustedDeviceServiceLocal

    • Field Detail

      • SECRET_KEY_LENGTH

        static final int SECRET_KEY_LENGTH
        Length in chars of the generated device key.
        See Also:
        Constant Field Values
    • Method Detail

      • checkForLogin

        void checkForLogin​(String remoteAddress,
                           String deviceConfirmationId,
                           String hmac)
        Checks the if the current trusted device can be used for login validating the given PENDING confirmation.
        This method only work for sessions with a trusted device, i.e if the current session data is not associated to a trusted device it throws an IllegalActionException
        Parameters:
        remoteAddress - the client address to check if it's already blocked or not
        deviceConfirmationId - the pending DeviceConfirmationType.LOGIN confirmation
        hmac - the HMAC generated in the client using its private key
      • exists

        boolean exists​(long id)
        Returns true if exist an active trusted device with the given id.
      • getDeviceActivationMode

        DeviceActivationMode getDeviceActivationMode()
        Calculates the device activation mode for the logged user according the the existing devices the user has, its available mediums and whether there is a channel requiring a trusted device for login.
      • hasActiveDevices

        boolean hasActiveDevices​(BasicUser user)
        Returns true if the given user has at least one active trusted device.
      • purgePendingActivations

        long purgePendingActivations​(Date before)
        Delete all trusted devices created before the date passed as parameter and which activation code is not null (they were not activated). Returns the count of deleted trusted devices.