Captive Portal Customizations - Venues

From Social ID Developers
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, otherwise it will be necessary to update the customization below to perform an intermediary mapping between the value informed by the device and the venue name.

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 device.
   setVenueFromQueryVariable("venue_name");
 
   // original code
   redirectToLogin();
 </script>
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox