User Tools

Site Tools


Create SMS/phone registration

The goal is to create a simple captive portal where subscribers can register themselves and their phone number. Once registered HSMX will send a text to the subscriber with the login credentials so (s)he can re-authenticate himself at a later moment.

Short summary of steps to perform:

  • Create registration form
  • Create custom portal

Configure a registration form

Free-access billing plan

First we need to head to Billing → Billing Plan to make sure there is one a billing plan of type Free access, otherwise create one. In our example we only configured bandwidth limits and set the expiration time-out to four hours with unlimited recurrence.

Create the registration form

Create a new registration form by browsing to Layout → Registration forms (use the +-icon in the sub-menu). In this example new subscribers are asked for an optional e-mail address and a mandatory cellphone number. Set the Billing Plan to your Free-access billing plan (if you only have one, it's selected by default).

Pick Generate username in the Username & password creation / Authentication section. Often times the username and password complexity is simplified to four character numbers to make it easy for subscribers to enter their credentials.

The next section configures the authentication handling; enable Send SMS and Autologin. A new block will appear to create SMS settings. The first tab contains the SMS contents settings. Pick a subject line and set a message. You can use special variables ||username|| and ||password|| in the message. Only print out the username if you enabled Voucher Code only in Layout→Settings.

The second SMS tab allows you to configure the SMS gateway settings. Refer to your SMS gateway documentation on how to setup this or contact support

Make sure to set a Name and tick both boxes in Misc and Save

* You can create a free account on a sms provider like

Setup the captive portal

It's possible to create a proper captive portal using the built-in HSMX Portal Editor however for this guide we'll use a custom portal because it's simpler and to provide a good code-example for captive-portal-makers.

Grab the SMS custom portal and browse to Layout → Portal Page. Add a new portal; give it a name and select Custom Portal as type and submit. Now upload the captive portal to the HSMX in the Upload custom portal page-block. You can deactivate all options but vouchers (under Login settings) and make sure to enable your SMS registration form.

We end this tutorial by configuring the portal rule, this will decide who and from where will be redirected to our Facebook custom portal. Edit the default rule and select your newly added portal under Select a portal page, you can leave all other options unchecked.


Once an unauthenticated subscriber tries to get online, he'll face our custom portal first and be given the choice to either authenticate or register. Once registered the subscriber will be able to browse the web, meanwhile a SMS is sent to the customer with a voucher code or user/pass credentials.


  • Disable auto-login and redirect to a custom page/login page. This forces the user to authenticate his phone number since the subscriber must use his/her credentials received via text. The downside is that if your SMS provider experiences service disruption the subscriber will have paid but is not able to log-on.
  • You can limit the amount of SMS messages being sent on the Restrictions tab in the registration form.
recipe/register-with-sms.txt · Last modified: 2021/06/03 14:40 (external edit)