EvilFreelancer / routeros-api-php

Mikrotik RouterOS API PHP client for your applications
https://mikrotik.com/software
MIT License
397 stars 145 forks source link

Can't login after update from 6.43.8 to 6.45.8 #29

Closed temandroid closed 4 years ago

temandroid commented 4 years ago

Version of RouterOS 6.45.8 (long-term)

To Reproduce Just login $conn = (new Config()) -> set('timeout', 10) -> set('host', '192.168.1.1') -> set('user', 'user') -> set('pass', 'pass') -> set('delay', 10) -> set('legacy', false); $ros = new Client($conn);

Expected behavior

Fatal error: Uncaught RouterOS\Exceptions\ClientException: Invalid user name or password in /var/www/localhost/htdocs/composer/vendor/evilfreelancer/routeros-api-php/src/Client.php:438 Stack trace: #0 /var/www/localhost/htdocs/composer/vendor/evilfreelancer/routeros-api-php/src/Client.php(481): RouterOS\Client->login() #1 /var/www/localhost/htdocs/composer/vendor/evilfreelancer/routeros-api-php/src/Client.php(60): RouterOS\Client->connect() #2 /var/www/localhost/htdocs/config.php(31): RouterOS\Client->__construct(Object(RouterOS\Config)) #3 /var/www/localhost/htdocs/inc_head.php(2): require('/var/www/localh...') #4 /var/www/localhost/htdocs/user.php(318): require('/var/www/localh...') #5 {main} thrown in /var/www/localhost/htdocs/composer/vendor/evilfreelancer/routeros-api-php/src/Client.php on line 438

EvilFreelancer commented 4 years ago

Hello! Thanks for report, I recommend to you rollback to some previous version, ill check your issue after couple hours. Btw, did you checked the login password? Messages about invalid credentials can be sometimes if ROS answered it after query.

PS. You may delete set('legacy', false), because "legacy" status will be detected automatically.

matracine commented 4 years ago

Hello,

For information : Mikrotik changed its authentication politics :

What's new in 6.45.3 (2019-Jul-29 12:11):

Important note!!! Due to removal of compatibility with old version passwords in this version, downgrading to any version prior to v6.43 (v6.42.12 and older) will clear all user passwords and allow password-less authentication. Please secure your >router after downgrading. Old API authentication method will also no longer work, see documentation for new login procedure: https://wiki.mikrotik.com/wiki/Manual:API#Initial_login

Le 25/02/2020 à 16:22, Paul Zloi a écrit :

Hello! Thanks for report, I recommend to you rollback to some previous version, ill check your issue after couple hours. Btw, did you checked the login password? Messages about invalid credentials can be sometimes if ROS answered it after query.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EvilFreelancer/routeros-api-php/issues/29?email_source=notifications&email_token=ABX4QD427LV7ZPYMSSFJRV3REUZSHA5CNFSM4K3KLYZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM4LW5Y#issuecomment-590920567, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABX4QDYFE2R72GKBS3UYALDREUZSHANCNFSM4K3KLYZQ.

temandroid commented 4 years ago

It's my fault, sorry, just updated your scripts to latest version and everything works great :)