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

Manually authorize guests #193

Closed tman785 closed 4 months ago

tman785 commented 1 year ago

I have an idea for my home guest network and want to see how to implement. I basically want to allow my frequent guests to use it but only if I manually authorize. Looks like I can use authorize_guest() to perform that step fine. However, how can I show/get any pending requests? I dont want to ask my guests for their mac addresses. In my mind, they would visit some portal, and they would be in a waiting state until I authorize. Thoughts on how I could accomplish this?

malle-pietje commented 1 year ago

Basically what you need to build is a external captive portal that collects the relevant data (mac address and maybe user name to help identify devices) snd stores this in a database table. You can then build an interface to review the pending devices and choose to authorize them using the API.

tman785 commented 1 year ago

Ok so I’m clear, the external portal will simply operate as a way to capture info and manually validate guests. Once the api to authorize guests is called, then unifi will no longer send the guest to the portal?

malle-pietje commented 1 year ago

Yes, correct, until the authorization (can set to 99 months for example) expires.