mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-05-09 08:25:29 +02:00
[GH-ISSUE #94] Is there an alternative to API access for self-hosted UniFi Controller after username/password authentication is deprecated? #51
Labels
No labels
bug
enhancement
pull-request
question
question
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/unifi-voucher-site#51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @berg-maia on GitHub (Aug 28, 2025).
Original GitHub issue: https://github.com/glenndehaan/unifi-voucher-site/issues/94
Originally assigned to: @glenndehaan on GitHub.
The question
I'm currently using a self-hosted UniFi Network Controller (version 9.3.45), installed locally.
I’m trying to access the controller via API, and currently, the only working method is using username/password-based authentication.
It doesn't have the Control Plane option to create the API Key or im just dump :)
@glenndehaan commented on GitHub (Aug 28, 2025):
Hi @berg-maia,
Unfortunately this is expected, Ubiquity created the API within the control plane that only exists within UniFi OS, the reason is that they consolidated all apps (Network, Protect, Access, etc.) into one API that should be more stable and allow more functions without rate-limits.
Now previously this was limited to Cloud Gateways and Cloud Keys, however they recently released the UniFi OS Software version.
This does mean you would need to migrate from the old software to the new one (should be as easy as taking a backup and restoring it), the official documentation is available here: https://help.ui.com/hc/en-us/articles/34210126298775-Self-Hosting-UniFi
I will also update the README to better reflect this.
Kind regards,
Glenn
@semka189 commented on GitHub (Dec 22, 2025):
@glenndehaan
Good afternoon.
Please tell me, I can’t find the API token.
I’ve almost finished preparing the server, but for it to work fully it requires a token.
Where is this function in UniFi (Network 10.0.162)?
I’ve checked everywhere, but I can’t find where to create this token.
The server writes: 2025-12-22 12:17:58.741 ERROR [UniFi] Integration API Key is not set within UNIFI_TOKEN environment variable!
@glenndehaan commented on GitHub (Dec 22, 2025):
@semka189 Please check my response above. It looks like you are using the older UniFi Network setup and not the newer selfhosted UniFi OS setup. You need to migate before yiu can use UniFi integrations. Of you need to switch to an older version of this application as described within the readme
@semka189 commented on GitHub (Dec 22, 2025):
@glenndehaan Thank you for the response.
I am using the latest version — Network Application: Network 10.0.162.
Now my question is: do I need to downgrade to an older version? Or how should I proceed? I didn’t quite understand this.
@glenndehaan commented on GitHub (Dec 22, 2025):
Yeah but the Network Server is the Legacy setup. You need to follow this guide to migrate to UniFi OS: https://help.ui.com/hc/en-us/articles/34210126298775-Self-Hosting-UniFi
@semka189 commented on GitHub (Dec 23, 2025):
@glenndehaan Thank you for the response.
I created a new UnifiOS Server and managed to create an API TOKEN. Then I integrated this token into the voucher server. Now the page opens, but I can't create [vouchers]—where's the problem?
@glenndehaan commented on GitHub (Dec 23, 2025):
Please check the logs for more details. My guess the IP is incorrect set or the token is incorrect
@semka189 commented on GitHub (Dec 23, 2025):
@glenndehaan Logs on the Voucher server? or on the UniFi OS server? and which command shows the logs?
@glenndehaan commented on GitHub (Dec 23, 2025):
That would be the logs for this app within the docker container
@semka189 commented on GitHub (Dec 23, 2025):
@glenndehaan Thanks for the reply. Yes, there was a problem, the port was incorrectly specified by the UniFiOs Server- it was 443 and it should have been 11443.
Everything is perfectly visible now.
The problem now is that when I connect to the guest network, I am redirected to the voucher page, but nothing is visible. The white page. Do you know what the problem is?
@glenndehaan commented on GitHub (Dec 23, 2025):
Good to hear. Your next issue is pretty much out of scope for this project. But my guess is a firewall block that prevents the captive portal to load
@semka189 commented on GitHub (Dec 23, 2025):
@glenndehaan Thanks for the reply. Yes, you were right, there was no network transfer. After I set it up, I now see this
Failed to open the web page
http://112.126../guest/s/default/?ap=a8:9c::::&id=aa:c8:::8a:...
an error occurred for the following reasons:
net::ERR_CONNECTION_TIMED_OUT
What can you say?
@glenndehaan commented on GitHub (Dec 23, 2025):
That would still lead me to believe something gets blocked
@semka189 commented on GitHub (Dec 24, 2025):
@glenndehaan Thanks for the reply.
To be sure, I transferred everything to one network. So, the voucher server -> controller server -> UniFi AP -> Guest Wi-Fi are all on the same network ..11.1. One server is 11.30, the other is 11.28, and so on. To rule out any doubts about the firewall.
Here is the server status.
When I connect, it redirects to the voucher server with this error.
I’ve done everything and checked, but it’s still not working. Do you have any ideas on how to fix it? Maybe the issue is inside Docker?"
The UniFi controller sees the entire voucher server with port 3000. There’s no doubt about that.
@glenndehaan commented on GitHub (Dec 24, 2025):
I think you are confused about what every part within this system provides. My application only provides a Voucher management app. It does not serve the Captive Portal on a UniFi Guest network. This is part of the native implementation of UniFi. So if you are running into connection issues with the Captive Portal thats not part of this application.
@semka189 commented on GitHub (Dec 24, 2025):
@glenndehaan Thank you for your response.
One moment, I'm glad you mentioned this – am I understanding correctly that this system only creates vouchers and manages them? I thought your system manages the guest network, asking for guest access upon connection. Unfortunately, that's how I understood it.
@glenndehaan commented on GitHub (Dec 24, 2025):
No, this system provides an alternative management UI then the built-in version from UniFi. It does not manage any networks and or provide Captive Portal pages. This application merely extends the native Hotspot UI found within the UniFi management console with features that are in my opinion long overdue. But it still relies on the internal system (UniFi Network) to handle guest authorization. Thats why there are no instructions within the README to configure this as an External Portal server, because it isn't.
So normally you would start of with setting everything up within UniFi Network until the basic Guest system works. Then if that works but you need extra functions or provide access to people without exposing the UniFi Console to them thats where this application comes into play.
@semka189 commented on GitHub (Dec 24, 2025):
@glenndehaan Thank you very much. I got the answers. Good luck with this project.