[NEBULA] Authentication for captive portal

2

Comments

  • Nebula_Bayardo
    Nebula_Bayardo Posts: 179  Zyxel Employee
    First Anniversary Friend Collector First Answer First Comment
    Hi Pinger,

    Yes, as RUnglabe mentioned, you can download the template provided in Gateway > Configure > Captive Portal and use the script to build your own captive portal:

    Click the "Download" link.

    Regarding the API, some of the items are not currently collected by Nebula Control Center so providing an API for this might take longer. 
    The information about "WiFI analytics integration (social media/3rd party AAA)" actually refers so future integration of Facebook login and some new releases in Nebula phase 3 as "Send clients’ parameter to integrate with 3rd party social Wi-Fi", but it's not related to API intergration so far.

    Cheers :),
    Bayardo 
  • Nebula_Bayardo
    Nebula_Bayardo Posts: 179  Zyxel Employee
    First Anniversary Friend Collector First Answer First Comment
    Hey @pinger

    Just to explain a little more: the 3rd party AAA feature recently released in phase 3 includes the AP and client IP & MAC address in the URL, highlighted as follow:

    This allows a better integration with 3rd party social WiFi.

    Hope this is more clear now


  • pinger
    pinger Posts: 13  Freshman Member
    Friend Collector First Comment
    edited July 2018
    Hi, I still have issues related to captive portal authentication. My setup is based on click through network access, which means, my code will do the authentication job, and I just need to know which parameters should I send back to my NSG50 to allow network access. Is the agree.cgi file in your example bundle the one to be called to finally provide network access?, if so, which parameters should I add to the call to this agree.cgi ?, what kind of call should I use (GET, POST)?.
    And btw, how can I get the client's mac?, does the NSG50 get the client mac address whenever a client tries to connect to WiFi network through an AP connected to the NSG?. It's crucial if I want to get some statistics.


    Thank you for your support.
  • Nebula_Bayardo
    Nebula_Bayardo Posts: 179  Zyxel Employee
    First Anniversary Friend Collector First Answer First Comment
    Hey @pinger, long time no see!

    As mentioned before, you can download the template of the captive portal on NCC, the path is Gateway > Configure > Captive Portal > External Captive Portal URL. I have attached the rar file for you.

    Inside the downloaded rar you will find the click_to_continue.HTML file. This HTML also includes the CSS section but you can change this part for your customized captive portal. However, the codes that must be kept are the javascript and POST contained in the form, as below:

    POST in form id= "loginform"
    <form id="loginform" name="f" action="/agree.cgi" enctype="application/x-www-form-urlencoded" method="post" onsubmit="NEBULA.submitEvent()">
                <ul class="container">
                    <li class="text-line"><span>Test, test, testing</span></li>
                </ul>
                <div class="well-come-box">
                    <input id="submit-btn" type="submit" class="button right" value="Agree">
                </div>
            </form>
    Javascript:
    <script type="application/javascript">(function (window, document, nebula) {'use strict';
    // handling form-post URL
    var postURL = nebula.acquireCallbackUrl();
    if (postURL) {
        document.getElementById('loginform').action = postURL;
    }
    
    })(window, window.document, window.NEBULA);</script>
    <br>
    BTW, if you enable to use an external captive portal URL, I recommend you to enable the promotion URL settings in the Captive portal behavior section as follow:

    As we have encountered some issues while using the other option. We will enhance this part for sure!

    Hope this is useful for you :) 
  • pinger
    pinger Posts: 13  Freshman Member
    Friend Collector First Comment
    edited July 2018

    Not sure if previous comment was finally posted twice (oops. It's still under investigation not posted here since I attached a .png file)

    BTW, we still need data such as client mac for statistics purposes, any chance to get these data from Nebula devices?


    Best regards


  • pinger
    pinger Posts: 13  Freshman Member
    Friend Collector First Comment

    Did you get my comment with attached .png file showing error 500?

    Best regards
  • pinger
    pinger Posts: 13  Freshman Member
    Friend Collector First Comment

    Unfortunately we're still getting 500 error (see screenshot below)



    Data used in our test:
    URL:
    => /hotspot/140214/register?url= /hotspot/140214/register <= settings on Zyxel NSG50 gateway.


    Execution code:
    <form method="POST" action="" accept-charset="UTF-8" style="display: block;"></form> with auto-submit via javascript


    Best regards
  • Nebula_Bayardo
    Nebula_Bayardo Posts: 179  Zyxel Employee
    First Anniversary Friend Collector First Answer First Comment
    Hi @pinger

    You need to use the exactly the same code as provided above, it doesn't need to be modified with IP address as the javascript will obtain the form-post URL.

    Both of the codes, javascript and loginform need to be used.
  • pinger
    pinger Posts: 13  Freshman Member
    Friend Collector First Comment

    Regarding data such as client mac for statistics purposes, any chance to get these data from Nebula devices?

  • Nebula_Bayardo
    Nebula_Bayardo Posts: 179  Zyxel Employee
    First Anniversary Friend Collector First Answer First Comment
    Hi Pinger,
    We have API support on our roadmap but not yet available.
    Currently, you can export client, APs info by using the export button (CSV and XML files) and the summary report by sending automatic emails which can be scheduled.

    I suggest using the Ideas section here in the forum or the Support Request from Nebula Control Center to explain us more about your business impact and what you need exactly, so we can prioritize this feature :) 

Nebula Tips & Tricks