问题
We're trying to find a way to authenticate a client via a mobile application rather than using a captive portal splash page. Is this possible at all?
I've looked at the CloudTrax API but can't seem to find anything that directly indicates the ability to authenticate users.
Another option I considered was trying to make a http request which would return the splash page and then with Javascript, imitate a click event on the authenticate button..
回答1:
If you use the cloudtrax http authentication then you should be able to do this fairly easily.
Cloudtrax HTTP auth sends an initial status request to your HTTP auth endpoint whenever a client connects to the wifi network if they haven't already got an authenticated session. This is before any login or captive portal popup is displayed. Your HTTP endpoint can respond to that request with an ACCEPT message along with session time and bandwidth restrictions. The AP will then just authenticate the device and allow it internet access without displaying any captive portal.
Not sure what your use case is for the mobile app (eg are you doing some other customer engagement inside the app?), but you could implement this without an app. Just push them to a captive portal the first time you detect their mac address, get them to register. Then all future connections can just be automated in the backend.
If you do need an app, then just do the registration part inside the app and have the app send their mac address to your backend server so the HTTP auth server can look it up in future.
来源:https://stackoverflow.com/questions/36799775/cloudtrax-programmatically-authenticate-client