-
-
Save malle-pietje/c030e9d6ccdc1c3ddfdfc4363ba79489 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> | |
<head> | |
<title><unifi txt="Redirector" /></title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<meta http-equiv="refresh" content="0;url=https://<YOUR CAPTIVE PORTAL URL>/<unifi var="mac" />/<unifi var="ap_mac" />"> | |
</head> | |
<body> | |
</body> | |
</html> |
Hi, do you know if this document still valid or obsolete?
https://help.ubnt.com/hc/en-us/articles/205143830-UniFi-Hotspot-portal-customization said that legacy method is no longer supported, but I still see it in Unifi controller.
Due to a completery lack of documentation from Unifi, a customized captive portal is a total nightmare...
I have a Unifi controller on IP 192.168.5.253 and I'M simply trying to set up an external captive portal on 192.168.5.240 but:
-
If external portal is selected on Unifi controller THERE IS NO WAY to get the pop up showed on Apple devices (only Android devices work as expected)
-
If Hotspot (Angular JS engine) is selected on Unifi controller popup is showed on Apple and Android devices... So I've tried to modify hotspot customizing index.hotspot.html with a javascript redirect. As said Android and Apple devices show login popup but (due to recent Unifi upgdades) now MAC ADDRESS OF THE CLIENT IS NO MORE PASSED by controller (it passes an "ec" var that is an encoded/encrypted parameter and only God is able to decode/decrypt it...)
So the question is ---unifi var="mac"--- does still work?
Many thanks
UBNT now actively support the AngularJS portal but the Legacy JSP portal is still available, so the method described here still works fine. It also prevents the encoded parameters (ec) from showing up, if that is an issue for your external portal I suggest you take this approach.
With our captive portal platform the ec parameter is automatically decoded so we can choose from both methods and use each of them as needed.
I've tried to the above mentioned index.html
But this is the result of the redirected link:
/portal/
I cannot get the mac address of the guest/client that connects.
I've tried to the above mentioned index.html
But this is the result of the redirected link:
/portal/I cannot get the mac address of the guest/client that connects.
This is not the expected result. Did you make sure not to use a Windows editor if your controller is running on Linux? Can you also confirm which guest control settings you changed?
I've tried to the above mentioned index.html
But this is the result of the redirected link:
/portal/
I cannot get the mac address of the guest/client that connects.This is not the expected result. Did you make sure not to use a Windows editor if your controller is running on Linux? Can you also confirm which guest control settings you changed?
Sorry for responding late. I have settled the problem the had single quotes instead of double quotes.
Thank you for your response to the earlier query.
That does make sense, thanks for the feedback.
Can this code be used if the unifi controller is being hosted online, cloud?
@malle-pietje Thank you so much for your help! <3
@malle-pietje Thank you so much for your help! <3
You’re welcome 👍
FYI legacy hotspot seems to be completely gone from Network 8.0.24, only the Angular seems to be left
Yes, that is correct. Here’s a first post on the Ubiquiti community where this topic is discussed:
https://community.ui.com/questions/Guest-portal-customization-html-css-with-the-new-UI-how-to-enable/81565820-50e2-4e6e-8bc6-b7c16877cb9a#answer/df1c3b80-6edd-4f75-a235-912f78afb994
Hi, Is today any way to implement this on the Angular constructor?
I need to redirect to my Cisco ISE guest portal, and i think this is the only way.
thank you in advnace.
BR.
Hi, Is today any way to implement this on the Angular constructor?
I need to redirect to my Cisco ISE guest portal, and i think this is the only way.
thank you in advnace.
BR.
AFAIK you can no longer modify the raw source-code of the captive portal unless someone else can confirm otherwise.
@SalimLeb This isn’t relevant to this gist AFAICT, may I suggest you create a thread on the UBNT community and add the “UniFi Wireless” tag?