Have same issue with upgrade to the new 6.45.1 firmware.Make sure your PHP code is using new authentication method:
https://wiki.mikrotik.com/wiki/Manual:API#Initial_login
I think that a proper warning about deprecated API authentication with this release was at least essential.Yes, make sure you are using new authentication method.
Sorry, can't see anything about deprecation of old-style authentication both in the changelogs or API link you posted above.There is already important note due to removal of compatibility with old version passwords.
Third party software should have been fixed long time ago ,new authentication method was introduced back in May 2018.
Important note!!!
Due to removal of compatibility with old version passwords in this version...
...
!) user - removed insecure password storage;
...
I still can't see any API-related warnings in the release.Important note!!!
Due to removal of compatibility with old version passwords in this version...
...
!) user - removed insecure password storage;
...
Yea, i basically did same thing in my patch i just wrote "how it fastly fix".Not true. See how it is done in our api example client:
https://wiki.mikrotik.com/wiki/Manual:A ... ple_client
We will add note regarding API, too.I didn't trying to hype on that, but I strongly believe that another important notice about old-style API authentication deprecation starts with this release will be very pleased for many MikroTik users.
Thank you.
$util->setMenu('/ip hotspot')->disable('hostspot1');
Looking forward to the release!Generating PHARs is a little bit difficult and time consuming right now, which is why I haven't done it yet... Since these new versions no longer support the old authentication method, I'll try to make a release this weekend.
Not true. See how it is done in our api example client:
https://wiki.mikrotik.com/wiki/Manual:A ... ple_client
Code: Select all
<?php
use PEAR2\Net\RouterOS;
require_once 'PEAR2_Net_RouterOS-1.0.0b6.phar';
try{
$util = new RouterOS\Util($client = new RouterOS\Client('ip','user','password'));
foreach ($util->setMenu('/log')->getAll() as $entry) {
echo $entry('time') . ' ' . $entry('topics') . ' ' . $entry('message') . "\n";
}
} catch (Exception $e) {
die($e);
}
?>
I would like to know too.when will it come out?
PEAR2_Net_RouterOS-1.0.0b7.phar
thanks
when will it come out?
PEAR2_Net_RouterOS-1.0.0b7.phar
thanks
Not working for me.For Login Using Php API, you need change in: routeros_api.classv1.6.php
$this->write('=response=00' . md5(chr(0) . $password . pack('H*', $MATCHES[0][1])));
for
$this->write('=password=' . $password);
UP!Hi
also looking forward to the release of Net_RouterOS-1.0.0b7
thanks
MAtteo
when will it come out?
PEAR2_Net_RouterOS-1.0.0b7.phar
thanks
UP!UP!Hi
also looking forward to the release of Net_RouterOS-1.0.0b7
thanks
MAtteo
when will it come out?
PEAR2_Net_RouterOS-1.0.0b7.phar
thanks
You can check the link - https://github.com/pear2/Net_RouterOS/wiki/Util-basicsHello, can anyone provide the download link for PEAR2_Net_RouterOS-1.0.0b7.phar ?
I cant see the update anywhere ...
You can check the link - https://github.com/pear2/Net_RouterOS/wiki/Util-basicsHello, can anyone provide the download link for PEAR2_Net_RouterOS-1.0.0b7.phar ?
I cant see the update anywhere ...
mkdir temp
cd temp
wget https://getcomposer.org/download/1.9.1/composer.phar
php composer.phar require pear2/net_transmitter:1.0.0b1 pear2/cache_shm pear2/net_routeros:dev-develop@dev
require_once 'PEAR2_Net_RouterOS-1.0.0b4.phar';
require __DIR__ . '/../composer/vendor/autoload.php';
where you able to fix this?Not true. See how it is done in our api example client:
https://wiki.mikrotik.com/wiki/Manual:A ... ple_client
Good day,
i did apply the new login method and i still get the same issue with V6.45.1 and up im using php .
Code: Select all
<?php
use PEAR2\Net\RouterOS;
require_once 'PEAR2_Net_RouterOS-1.0.0b6.phar';
try{
$util = new RouterOS\Util($client = new RouterOS\Client('ip','user','password'));
foreach ($util->setMenu('/log')->getAll() as $entry) {
echo $entry('time') . ' ' . $entry('topics') . ' ' . $entry('message') . "\n";
}
} catch (Exception $e) {
die($e);
}
?>
-------------------------------------OUT PUT--------------------------------------------------------------
PEAR2\Net\RouterOS\DataFlowException: Invalid username or password supplied. in phar://C:/xampp/htdocs/test2/PEAR2_Net_RouterOS-1.0.0b6.phar/PEAR2_Net_RouterOS-1.0.0b6/src/PEAR2/Net/RouterOS/Client.php:175 Stack trace: #0 C:\xampp\htdocs\test2\example.php(8): PEAR2\Net\RouterOS\Client->__construct('ip', 'user', 'password') #1 {main}
I Don't figure it out why I'm getting the error.
Hi everyone, for all of you that are workin with PEAR2 API, here is the solution:
1. Uncompress the .phar file
2. Go to the uncompressed folder -> PEAR2_Net_RouterOS-1.0.0b6\src\PEAR2\Net\RouterOS and edit the Client.php file
3. Find the _login function and modify it to look exactly like this:
private static function _login(
Communicator $com,
$username,
$password = '',
$timeout = null
) {
$request = new Request('/login');
$request->setArgument('name', $username);
$request->setArgument('password', $password);
$request->verify($com)->send($com);
$response = new Response($com, false, $timeout);
if ($response->getType() === Response::TYPE_FINAL) {
return null === $response->getProperty('ret');
} else {
while ($response->getType() !== Response::TYPE_FINAL
&& $response->getType() !== Response::TYPE_FATAL
) {
$response = new Response($com, false, $timeout);
}
return false;
}
}
4. Finally make sure you have the uncompressed and edited folder where you had your .phar file and change your project's php like this:
Replace -> require_once 'PEAR2_Net_RouterOS-1.0.0b6.phar'; for -> require_once 'PEAR2_Net_RouterOS-1.0.0b6/src/PEAR2/Autoload.php';
Now you should be able to connect with the new versions of RouterOS.
its worked for me thanksNot working for me.For Login Using Php API, you need change in: routeros_api.classv1.6.php
$this->write('=response=00' . md5(chr(0) . $password . pack('H*', $MATCHES[0][1])));
for
$this->write('=password=' . $password);
Thanks man you really help me !!!! I waste a cup of days trying this f... error, thank you very much!For Login Using Php API, you need change in: routeros_api.classv1.6.php
$this->write('=response=00' . md5(chr(0) . $password . pack('H*', $MATCHES[0][1])));
for
$this->write('=password=' . $password);