Find us on facebook

Oct 29, 2016

CISCO Meraki Splash Page Configuration - Basic - With Lumen

First access CISCO Meraki dashboard and setup Splash URL.

When wireless client open the browser and makes HTTP request , it will be automatically redirected to this URL with some useful parameters. If we redirect this to lumen, It would be like,

    /**
     * [click - click through splash page].
     *
     * @param Request $request
     *
     * @return [type]
     */
    public function click(Request $request)
    {
        $baseGrantUrl = $request->input('base_grant_url');
        $userContinueUrl = $request->input('user_continue_url');
        $nodeMac = $request->input('node_mac');
        $clientIp = $request->input('client_ip');
        $clientMac = $request->input('client_mac');
        $data = array('baseGrantUrl' => $baseGrantUrl,
                      'userContinueUrl' => $userContinueUrl,
                      'nodeMac' => $nodeMac,
                      'clientIp' => $clientIp,
                      'clientMac' => $clientMac);
        return view('splash.click_through', ['data' => $data]);
    }

click_through.blade.php

        <form action="/api/v1/splash/signin" method="post" class="form col-md-12 center-block">
        <input type="hidden" name="baseGrantUrl" value="{{$data['baseGrantUrl']}}">
        <input type="hidden" name="userContinueUrl" value="{{$data['userContinueUrl']}}">
        <div class="form-group">
          <input class="form-control input-lg" placeholder="Email" type="text" name="email" required>
        </div>

        <div class="form-group">
          <button class="btn btn-primary btn-lg btn-block">Sign In</button>
        </div>
        </form>

signin

    /**
     * [signin - splash page signin].
     *
     * @param Request $request
     *
     * @return [type]
     */
    public function signin(Request $request)
    {
        $url = $request->input('baseGrantUrl')."?continue_url="."http://xxxx.xxxx.com/api/v1/splash/success"."&duration=300";
        return view('splash.signin', ['url' => $url]);
    }

signin.blade.php

      <h1>Login</h1>
      <a href="{{$url}}">Click here to Continue....</p>

success

    /**
     * [success - splash page success].
     *
     * @param Request $request
     *
     * @return [type]
     */
    public function success(Request $request)
    {
        return view('splash.success');
    }

success.blade.php

     <h1>Success</h1>
 

No comments:

Post a Comment