Can't Access Unifi Unauthorized Access

I am getting the following errors now after activating 2FA on unifi. Is there something I need to do in order to correct the issue:

* Exception on update Call https://192.168.7.xxx:443/proxy/network/api/s/default/rest/dpigroup received 401 Unauthorized
* Exception on update Call https://192.168.7.xxx:443/proxy/network/api/s/default/rest/portforward received 401 Unauthorized
* Exception on update Call https://192.168.7.xxx:443/proxy/network/api/self/sites received 401 Unauthorized
* Exception on update Call https://192.168.7.xxx:443/proxy/network/api/s/default/stat/sysinfo received 401 Unauthorized
* Exception on update Call https://192.168.7.xxx:443/proxy/network/api/s/default/rest/wlanconf received 401 Unauthorized

Define a local user account in the controller and use that to integrate to HA. The local users do not have the MFA requirement. Settings → System → Advanced → under device authentication.

1 Like

I must be doing something wrong - I tried your suggestion and I just get invalid credentials.

Try making the local account an admin account.

Hi - all sorted. Thanks :slight_smile:

Would be great if you say what you did to sort it for the next person that searches for the same problem :slight_smile: Was it making it an admin that solved it?

The route to the device authentication wasn’t correct. I simply clicked “Admins” and added a new user.

image

Aha, I was referring to the SSH authentication apparently. Glad you sorted it.

To clarify I found the local account creation on a slightly different location:
OS Settings → Admins & Users → Add Admin

image

image

UniFi OS 3.2.12

I am on Unifi OS 4.0.6.

I created a local admin before and had been using it without issue. In the recent HA update, it seems the authentication is broken somehow.

I can create the Unifi Network entities but when I try to switch on/off Port Forwarding rules via HA, I get authenication errors.

Same deal here. This worked fine until a few days ago, to try and fix it I now made the local account and still get a ton of “received 401 Unauthorized” errors in my log.

Came here because I had the same problem. Simply reloading the hub in the UniFi Network integration solved the issue for me. Screenshot below for reference:

Following up on this… it seems I need to Reload the integration after every single restart of Home Assistant. Something is breaking during the Startup process of Home Assistant and the integration itself… pretty annoying.