RADIUSdesk

This is an old revision of the document!


CoovaChilli JSON Interface

Introduction

  • If CoovaChilli is compiled with JSON support it exposes a JSON interface on the controller.
  • This document will discuss the technical workings of the JSON interface.
  • In order to have access to the JSON interface you have to be on the same network served by CoovaChilli, this means you have to be connected to the hotspot in plain english.

Accessing the JSON interface

Specifying a Callback

jQuery33105641008201093548_1612410177983({"versio......28-D2-44-20-04-8D"}})

The JSON interface methods

  • The JSON interface has three endpoints exposed. They are
    • status Report on the current status of the client from which you are making the call
    • logon Used to log a user onto the captive portal. Needs a valid RADIUS username and encrypted password.
    • logoff Used to disconnect a user that has an active session on the captive portal.

We will now unpack each of these endpoints in their own dedicated session

status

  • The reply of a status call will indicate the current connection status of a client / user from where the call was made.
  • Here is a typical reply when the user is not connected
{
   "version":"1.0",
   "clientState":0,
   "nasid":"ZA-VM1",
   "challenge":"0caeb2c0240fca8f430ea54e6423151e",
   "location":{"name":"My HotSpot"},
   "redir":{
      "originalURL":"http://detectportal.firefox.com/success.txt",
      "redirectionURL":"",
      "logoutURL":"http://10.1.0.1:3990/logoff",
      "ipAddress":"10.1.0.2",
      "macAddress":"28-D2-44-70-04-00"
    }
}
  • Here is a typical reply when the user is connected
{
   "version":"1.0",
   "clientState":1,
   "nasid":"ZA-VM1",
   "redir": {
      "originalURL":"http://detectportal.firefox.com/success.txt",
      "redirectionURL":"",
      "logoutURL":"http://10.1.0.1:3990/logoff",
      "ipAddress":"10.1.0.2",
      "macAddress":"28-D2-44-70-04-00"
   },
   "session":{
      "sessionId":"161241022400000001",
      "userName":"click_to_connect@demo1",
      "startTime":1612410289,
      "sessionTimeout":0,"terminateTime":0,
      "idleTimeout":0,
      "maxTotalOctets":249823541
   },
   "accounting":{
      "sessionTime":15,
      "idleTime":0,
      "inputOctets":144606,
      "outputOctets":85859,
      "inputGigawords":0,
      "outputGigawords":0,
      "viewPoint":"client"
   }
}
  • The item that indicates if there is an active session is the value of ClientState
    • 0 No active session
    • 1 Active session

logon

llogoff