Community discussions

MikroTik App
 
paulley
newbie
Topic Author
Posts: 26
Joined: Thu Aug 30, 2012 4:15 pm

HTTP Post Create User

Wed Jan 20, 2016 7:08 pm

Hi,

I was wondering, if the Usermanager which runs locally on a Mikrotik RB can create Hotspot Users, (probably fireing api commands?) can i use these commands (locally on the RB) too?

I cant imagine that i cant build an Selfregister html site (without payment!) which creates a usermanager (Radius) user.

Ive already build an AngularJS Login.html which retrieves an Facebook User his Email address, the only obstacle is to add this user to the local UserManager database.

As far as i know the routerboard/mikrotik cant handle PHP, so i tried to analyze the Usermanager app (Chrome F12 function), but this app dont uses HTTP-Post to create users...

How does the usermanager this, and is this also available for us? (When not, why not?)

Kind Regards,
Paul
 
dkalam
just joined
Posts: 17
Joined: Fri Aug 13, 2004 1:18 pm

Wed Jan 20, 2016 7:15 pm

Would also like to know if a method like the one discribed above, exists...

Στάλθηκε από το Redmi Note 3 μου χρησιμοποιώντας Tapatalk
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: HTTP Post Create User

Wed Jan 20, 2016 7:29 pm

This is outside of my wheelhouse as to the "how to actually do it" nuts and bolts, but in general, I can tell you that you could make an account creation form on any server you like - permit the "sign up page" in the walled garden, and then use the API connection to add/remove users on the Mikrotik itself.

Of course, this is about the same amount of effort required to make the signup site just drop a row into a mysql table, and use RADIUS authentication (FreeRADIUS can use a mysql back-end)
 
paulley
newbie
Topic Author
Posts: 26
Joined: Thu Aug 30, 2012 4:15 pm

Re: HTTP Post Create User

Fri Jan 22, 2016 8:43 am

Unfortunately in your scenario it requires a External Server. I can't provide an External Server (various reasons).
So im looking for a out of the box (Routerboard) solution.

So my thought, when the usermanager can do it, it must be possible. The usermanager is a "kind of" WebApplication running on a "kind of" webserver......

Q: In your Solution of adding/removing users on the MT itself, then the Server must know the IP-address of the MT, right?
This is outside of my wheelhouse as to the "how to actually do it" nuts and bolts, but in general, I can tell you that you could make an account creation form on any server you like - permit the "sign up page" in the walled garden, and then use the API connection to add/remove users on the Mikrotik itself.

Of course, this is about the same amount of effort required to make the signup site just drop a row into a mysql table, and use RADIUS authentication (FreeRADIUS can use a mysql back-end)
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: HTTP Post Create User

Fri Jan 22, 2016 5:00 pm

So my thought, when the usermanager can do it, it must be possible. The usermanager is a "kind of" WebApplication running on a "kind of" webserver......
Yeah, but it's an application that speaks HTTP as one of its functions, not a web server that you can put content into. So if there's not a feature built into it, or a behavior that's possible via the existing features, then you can't "roll-your-own" feature with some PHP or Java or somesuch....

There very well could be a way to make Usermanager give free accounts that doesn't feel wrong - "oh just leave the credit card number field blank, it'll be fine" I'm just not the one to make such a suggestion as I've never used it.
Q: In your Solution of adding/removing users on the MT itself, then the Server must know the IP-address of the MT, right?
Yeah - and I would recommend using a DNS hostname and not a hard-coded IP address in such a thing, because it makes changing the IP harder. Also note that the server doesn't have to be at the same site as the Mikrotik - you could even spin up an Amazon web host or something like that.