Captive Portal Customizations - Venues

From Social ID Developers
Revision as of 15:41, 19 October 2021 by Gabriel.prado (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Description

Most Wi-Fi vendors provide the AP mac address, which allows the platform to identify the registered device and the associated venue.

For vendors that do not support this automatic flow you can build a custom one using the Wi-Fi Javascript APIs.

Customization Example

Update your vendor configuration to add an extra "venue_name" (you can use any other value if necessary, e.g. "identity", "server_name", etc) query variable when redirecting to the Auth page. Also make sure that the value of this variable matches exactly the name of the venue configured in the Wi-Fi admin dashboard.

Then, replace the HTML Code for the "Auth Page" template with the following code:

 <script type="text/javascript">
   function setVenueFromQueryVariable(variable) {
     var api = new socialid.wifi.API(appConfig.path_name),
       venue = socialid.wifi.util.getQueryVariable(variable);
 
     if (venue) {
       api.setVenue(venue);
     }
   }
 
   // update "venue_name" to match the value configured in your vendor equipment.
   setVenueFromQueryVariable("venue_name");
 
   // original code
   redirectToLogin();
 </script>
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox