This page will discuss the process when someone connects through CoovaChilli Captive Portal to the Internet. It also shows how to use the JSON interface available on CoovaChilli to log in. See the following diagram and the explanation that follows.
Configuration Item
Function
Typical Value
HS_UAMHOMEPAGE
Used as a splash page
HS_UAMHOMEPAGE=http://\$HS_UAMLISTEN/coova_json/splash.php
HS_UAMFORMAT
Used as a login page
HS_UAMFORMAT=http://\$HS_UAMLISTEN/mobile/mobile.php
Query string Item
Description
Typical Value
res
The result of the connection attempt
notyet
uamip
The IP Address of the Captive Portal gateway
10.1.0.1
uamport
The port on which the Captive Portal will serve web content (/www) and run the JSON web service (/json)
3990
challenge
A challenge that should be used together with the user's password to create an encrypted phrase used to log on
0af969874aa833e6989006f0b2f41793
called
The MAC address of the IP Address of the Captive Portal gateway
08-00-27-56-22-0B
mac
The MAC address of the client trying to gain Internet access
08-00-27-3E-84-A7
ip
The IP Address of the client trying to gain Internet access
10.1.0.2
nasid
An identification for the Captive Portal used in the RADIUS request
Residence_Inn
userurl
The URL which the user tried to access before he were redirected to the Captive Portal's URL's pages
http%3a%2f%2fiol.co.za%2f
Item
Value
CoovaChilli gateway
10.1.0.1
Client IP
10.1.0.2
UAM Port
3990
JavaScript Callback
coova_complete
Here's the feedback on my set-up.
coova_complete({"version":"1.0","!clientState":0,"challenge":"de96c43d2b5786312fb97a21940390d2","location":{"name":"My HotSpot"},"redir":{"originalURL":"http://10.1.0.1:3990/status/?callback=coova_complete","redirectionURL":"","logoutURL":"http://10.1.0.1:3990/logoff","macAddress":"08-00-27-3E-84-A7"}})
Two items in the reply is important clientState and challenge.
Here's my feedback
coova_complete({'response':'d25e267196a1337d6a695485f5e18db6'})
If the connection was successful you will get feedback like the following:
coova_complete({"version":"1.0","clientState":1,"redir":{"originalURL":"http://10.1.0.1:3990/connect?callback=coova_complete&username=dvdwalt@ri&password=d25e267196a1337d6a695485f5e18db6","redirectionURL":"","logoutURL":"http://10.1.0.1:3990/logoff","macAddress":"08-00-27-3E-84-A7"},"session":{"sessionId":"4f2eeb7b00000001","userName":"dvdwalt@ri","startTime":21748,"sessionTimeout":0,"idleTimeout":900},"accounting":{"sessionTime":0,"idleTime":0,"inputOctets":0,"outputOctets":0,"inputGigawords":0,"outputGigawords":0}})
As you can see the connection was made fine looking at the value of clientState.
Should the password be wrong you will be notified in the feedback:
coova_complete({"version":"1.0","clientState":0,"message":"Password Incorrect","challenge":"dae5ba16691d4889e4051214d027c0ac","redir":{"originalURL":"http://10.1.0.1:3990/connect?callback=coova_complete&username=dvdwalt@ri&password=d25e267196a1337d6a695485f5e18db6","redirectionURL":"","logoutURL":"http://10.1.0.1:3990/logoff","macAddress":"08-00-27-3E-84-A7"}})
Confirm than that the challenge is correct by visiting the status page again and also compare the shared secret between the CoovaChilli Captive Portal and the uam.php page then try again.
http://10.1.0.1:3990/json/logoff?callback=coova_complete
Here's the feedback:
coova_complete({"version":"1.0","clientState":0,"challenge":"3695b44168811723193c5f37099e7d2d","session":{"sessionId":"4f2eec6400000001","userName":"dvdwalt@ri","startTime":21748,"sessionTimeout":0,"idleTimeout":0},"accounting":{"sessionTime":519,"idleTime":515,"inputOctets":104,"outputOctets":132,"inputGigawords":0,"outputGigawords":0}})