Art-of-WiFi / UniFi-API-client

A PHP API client class to interact with Ubiquiti's UniFi Controller API
MIT License
1.09k stars 217 forks source link

Authentication failed with 1.1.79 and Unifi OS 1.12.30 #179

Closed umueller74 closed 1 year ago

umueller74 commented 1 year ago

Suddenly my scripts stopped working:

`-----------LOGIN------------- Array ( [url] => https://192.168.0.1/api/auth/login [content_type] => application/json; charset=utf-8 [http_code] => 403 [header_size] => 546 [request_size] => 183 [filetime] => -1 [ssl_verify_result] => 18 [redirect_count] => 0 [total_time] => 0.10857 [namelookup_time] => 0.000403 [connect_time] => 0.00041 [pretransfer_time] => 0.001897 [size_upload] => 49 [size_download] => 75 [speed_download] => 694 [speed_upload] => 453 [download_content_length] => 75 [upload_content_length] => 49 [starttransfer_time] => 0.001927 [redirect_time] => 0 [redirect_url] => [primary_ip] => 192.168.0.1 [certinfo] => Array ( ) [primary_port] => 443 [local_ip] => 192.168.0.52 [local_port] => 59910 [http_version] => 3 [protocol] => 2 [ssl_verifyresult] => 0 [scheme] => HTTPS [appconnect_time_us] => 414 [connect_time_us] => 410 [namelookup_time_us] => 403 [pretransfer_time_us] => 1897 [redirect_time_us] => 0 [starttransfer_time_us] => 1927 [total_time_us] => 108570 )

----------RESPONSE----------- { "code": "AUTHENTICATION_FAILED", "message": "Authentication failed" } ----------------------------- `

ATM I have no clue why.

User and Password hasn’t been changed.

any hints?

Regards Udo

malle-pietje commented 1 year ago

I’m afraid I cannot replicate this. Just double checked connecting remotely through the WAN interface to a UDM PRO running the same version of UniFi OS and the same client version works perfectly fine. Double check the local user permissions or create a new one.

umueller74 commented 1 year ago

I’m afraid I cannot replicate this. Just double checked connecting remotely through the WAN interface to a UDM PRO running the same version of UniFi OS and the same client version works perfectly fine. Double check the local user permissions or create a new one.

I created a new one and this one works. Strange, nothing was changed for the former API user.

TY!

malle-pietje commented 1 year ago

Thanks for the update! Closing.

umueller74 commented 1 year ago

FYI: The login error happened again after a day or so. This night the firmware of the UDM Pro was updated to 1.12.33 and since then the old (and the new) login is working again as before.

malle-pietje commented 1 year ago

Thanks for reporting. Sounds like an odd bug in UniFi OS. Maybe the UniFi OS devs are following this repo?:wink:

umueller74 commented 1 year ago

At least that would help to notice some bugs 😜😎