public function validateDeviceValidationToken()
    {
        $username = $this->httpRequest()->post('username');
        $deviceValidationToken = $this->httpRequest()->post('deviceValidationToken');

        $result = $this->getLoginInstance()->validateDeviceConfirmationToken($username, $deviceValidationToken);
        if ($result) {
            return ['deviceToken' => $result];
        } else {
            throw new RestErrorException('Device validation error.',
                'The provided device validation token is invalid.');
        }
    }