[GH-ISSUE #94] Is there an alternative to API access for self-hosted UniFi Controller after username/password authentication is deprecated? #51

Closed
opened 2026-05-07 00:18:20 +02:00 by BreizhHardware · 18 comments

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 :)

Image
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 :) <img width="339" height="750" alt="Image" src="https://github.com/user-attachments/assets/1756a09b-5ab0-45fb-851d-1d5a5904f9e4" />
BreizhHardware 2026-05-07 00:18:20 +02:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@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

<!-- gh-comment-id:3234256843 --> @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
Author
Owner

@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!

Image

<!-- gh-comment-id:3682042683 --> @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! ![Image](https://github.com/user-attachments/assets/02173c34-fec7-4031-8466-e67e5480a832)
Author
Owner

@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

<!-- gh-comment-id:3682086105 --> @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
Author
Owner

@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.

<!-- gh-comment-id:3682111915 --> @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.
Author
Owner

@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

<!-- gh-comment-id:3682121096 --> @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
Author
Owner

@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?

Image

Image

<!-- gh-comment-id:3686469501 --> @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? ![Image](https://github.com/user-attachments/assets/3091f57b-2a2e-4c26-a388-76a155c4ea12) ![Image](https://github.com/user-attachments/assets/d0e4657e-e153-46e1-8d14-30c53bc8e40c)
Author
Owner

@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

<!-- gh-comment-id:3686477909 --> @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
Author
Owner

@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?

<!-- gh-comment-id:3686482179 --> @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?
Author
Owner

@glenndehaan commented on GitHub (Dec 23, 2025):

That would be the logs for this app within the docker container

<!-- gh-comment-id:3686497390 --> @glenndehaan commented on GitHub (Dec 23, 2025): That would be the logs for this app within the docker container
Author
Owner

@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.

UNIFI_IP: "***.***.**.**"
  UNIFI_PORT: 11443
  UNIFI_TOKEN: "******"
  UNIFI_SITE_ID: "default"

Everything is perfectly visible now.

Image

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?

<!-- gh-comment-id:3686685892 --> @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. UNIFI_IP: "***.***.**.**" UNIFI_PORT: 11443 UNIFI_TOKEN: "******" UNIFI_SITE_ID: "default" Everything is perfectly visible now. ![Image](https://github.com/user-attachments/assets/7874ac0d-3973-4d5a-98d6-73342bae2e13) 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?
Author
Owner

@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

<!-- gh-comment-id:3686713540 --> @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
Author
Owner

@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?

<!-- gh-comment-id:3686754701 --> @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?
Author
Owner

@glenndehaan commented on GitHub (Dec 23, 2025):

That would still lead me to believe something gets blocked

<!-- gh-comment-id:3686812190 --> @glenndehaan commented on GitHub (Dec 23, 2025): That would still lead me to believe something gets blocked
Author
Owner

@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.

Image

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?"

Image

The UniFi controller sees the entire voucher server with port 3000. There’s no doubt about that.

<!-- gh-comment-id:3688850141 --> @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. ![Image](https://github.com/user-attachments/assets/77413d64-4dd4-4726-b8f2-1d8cd845ce18) 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?" ![Image](https://github.com/user-attachments/assets/9b77f8ae-2650-4f6c-82b0-884bd92cc662) The UniFi controller sees the entire voucher server with port 3000. There’s no doubt about that.
Author
Owner

@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.

<!-- gh-comment-id:3689060827 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:3689098181 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:3689125191 --> @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.
Author
Owner

@semka189 commented on GitHub (Dec 24, 2025):

@glenndehaan Thank you very much. I got the answers. Good luck with this project.

<!-- gh-comment-id:3689150612 --> @semka189 commented on GitHub (Dec 24, 2025): @glenndehaan Thank you very much. I got the answers. Good luck with this project.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/unifi-voucher-site#51
No description provided.