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
      • ACTIVATION_CODE_LENGTH

        static final int ACTIVATION_CODE_LENGTH
        Length in chars of the generated device activation code.
        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.
      • hasActiveDevices

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

        boolean hasAvailableSendMediums()
        Returns true if the logged user has at least one medium to send to the activation code.
      • isRequireTrustedDeviceForLogin

        boolean isRequireTrustedDeviceForLogin()
        Returns true if at least one channel (not only the current channel) requires trusted devices for login
      • 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.