Unifi Integration - add support for MFA

The unifi integration only supports regular username/password authentication. Many unifi controllers are configured for MFA and therefore it would be good if the HA integration could also support MFA auth for Unifi.

Fair point. But I think that it’s impossible as long as the API doesn’t work with some other way (like keys and secrets etc.) Because how else would HA be able to log in while you are away? Or do you mean it should make a persistent connection and use some sort of keep-alive poll to never log out of the unifi after you manually did the MFA?

Has someone reverse engineered this MFA mechanism?

You can log in using the format password|auth but it doesn’t seem to persist properly. I’m constantly having the integration disconnect, but I hadn’t troubleshot it enough to know if it’s on every reboot, or just on every update.

Some better method of session persistence may resolve this.

(ps: I’ve up-voted)

Better yet … duh. I don’t know why I forgot about this: create a local read-only admin user for HA. This will by-pass 2FA and prevent any session resetting from restarts or updates.

1 Like

So while I was able to use the local admin interface for the last year that is now no longer an option following Ubiquiti’s decision to remove local logins from controllers. We now need a solution that also uses the ubiquiti cloud login.

AFAIK local users are still possible to create.

Found this and just wanted to upvote. Worked for me.