Integration with external login page for guess access

Hello,

I would like to centralize the logins from a server, for example, the user connects to wifi, and receives a form to fill in the user and password, but in all the examples I have seen so far, I realized that I should send the form by POST directly from the client to the AP Cambium, but what I would like was to send the POST via PHP from my WEB server but the answer I always have is "Error: Failed to connect to 0.0.0.0 port 880: Connection timed out ", is this model possible to work?

Attached, my php code, it works from the place where the wifi connection is being made, but it does not work from the WEB server.

best regards

hi,

your ask is post from web-server to cnPiolt AP instead of doing post from guest client to AP. If yes, this can be done. can you refer the attached intgeration document which gives sample code and packet capture content with examples. 

yes, i have this document, but my PHP script only works if the code is run from a client, if I run the code from the webserver, it doesn't work. do i need to release any port on cnpilot for the webserver to be able to send a post to it? since who is connected to it is the client (cell phone)

in the sample php code, ga_srvr should be cnPiolt AP and it is ben set as 0.0.0.0 what os reason for this one?

can you share us,

1. final actual post message you are constructing 

2. on ap what is the autnetication method has been selected

3. packet catpure between ap and your server shall help better 

Post directly from a webserver is supported when AP is managed through cnMaestro On premesis version. There is an option in WLAN guest-access configuration checkbox "External Portal Post Through cnMaestro" which when enabled will point the ga_srvr_ip in redirection query strings to the cnMaestro server IP/hostname as configured in the cnMaestro guest portal Services->Guest Portal "Guest Portal Hostname / IP". Under this flow all login POST requests will be sent to cnMaestro server and it will communicate to AP.

This will not work if you are using cloud version of cnMaestro to manage your devices.

1 Like

ok, let me see if I understand:

Step 1: "External Portal Post Through cnMaestro" <= this is ok
Step 2: "Services-> Guest Portal" Guest Portal Hostname / IP "<= this is ok

cnPilot IP: 172.18.79.2
cnMaestro: 189.14.224.169 / adn169.adyl.srv.br

now should i send the post to the ip / cnMestro domain?

ex: curl http://adn169.adyl.srv.br? and do I need to use port 880?

regards

I am sorry I should have given below details in my last response itself.

For the external captive portal integration there is small change which will be required in the login/logout POST URL:

Current post on AP happens to “http…./cgi-bin/hotspot_login.cgi”

When you configure “through-controller” for cnMaestro based the Post will happen to “https://cnMaestroHostName/cn-ctlr/ext-guest/ga-ext-login”

and https://cnMaestroHostName/cn-ctlr/ext-guest/ga-ext-logout . Rest everything remains the same, they pick the ga_srvr_ip same as they do today for POST and with through-controller the value points to cnMaestro hostname/IP-Address.

An example curl request to perform login request:

curl -v -k -d "ga_user=test_user&ga_pass=testing123" -X POST https://10.140.137.40/cn-ctlr/ext-guest/ga-ext-login?ga_ssid=testCnMaestroExtPortal&ga_ap_mac=00-04-56-F8-33-60&ga_nas_id=E400-F83360&ga_srvr=10.140.137.40&ga_cmac=00-24-D7-D4-2D-64&s=0HFYBNaS1V3iYZ8TE1F0gFQ7mDoxElmJXlzZ0Qxs0-ws.&ga_Qv=fEROBR86HBgAGDEEVgQAGw4UWRUCACYVMgFPQVtZK1BfUSVGXipFVXtZQ1FLBhMUMww.

Logout request example:

curl -v -k  -X POST https://10.140.137.40/cn-ctlr/ext-guest/ga-ext-logout?ga_ssid=testCnMaestroExtPortal&ga_ap_mac=00-04-56-F8-33-60&ga_nas_id=E400-F83360&ga_srvr=10.140.137.40&ga_cmac=00-24-D7-D4-2D-64&s=0HFYBNaS1V3iYZ8TE1F0gFQ7mDoxElmJXlzZ0Qxs0-ws.&ga_Qv=fEROBR86HBgAGDEEVgQAGw4UWRUCACYVMgFPQVtZK1BfUSVGXipFVXtZQ1FLBhMUMww.

I your case you can replace the 10.140.137.40 to be adn169.adyl.srv.br

2 Likes

that was exactly what I needed, it worked!

impressive the amount of research I did and I didn't find it. you saved me, thank you very much and I hope this solution works for other people too.

Best Regards

Hi Kunal, thanks for your post.

I’m using cnMaestro cloud and in my case, i’m receiving “us-e1-guest.cloud.cambiumnetworks.com” in ga_srvr.

But when i’m try do POST https://us-e1-guest.cloud.cambiumnetworks.com/cn-ctlr/ext-guest/ga-ext-login?…, i’m receiving 404 status code.

Tnks
Luciano.