Community discussions

MUM Europe 2020
 
zeroum
just joined
Topic Author
Posts: 7
Joined: Fri Mar 10, 2017 6:16 pm

Facebook SDK for javascript and Mikrotik router

Fri Mar 10, 2017 6:37 pm

So I been going back and foward with my mikrotik router for a couple of months now. I have created an hotspot with the router effortlessly, and now the next step has been to enable facebook authentication to connect to the network. The hotspot login page that I created, works as it should, but the facebook login app that I created to login with facebook (instead of a mikrotik created user) does not even show the buttons. I am quite lost what might be issue.
The login files are online, so the mikrotik router "fetch"s them from the location that I uploaded them to. If I connect directly to the online location, the hotspot login page shows as it should (with the facebook buttons and all), BUT once you try to connect to the hotspot and you are redirected to the same hotspot login page, the facebook buttons that I defined in that hotspot login page, are nowhere to be seen.
/interface set ether1 name="ether1-gateway";
/ip dhcp-client add interface=ether1-gateway disabled=no comment="default configuration";
/interface bridge add name=bridge-local disabled=no auto-mac=yes protocol-mode=rstp;
/ip address add address=192.168.88.1/24 interface=bridge-local comment="default configuration";
/ip pool add name="default-dhcp" ranges=192.168.88.10-192.168.88.254;
/ip dhcp-server add name=default address-pool="default-dhcp" interface=bridge-local lease-time=10m disabled=no;
/ip dhcp-server network add address=192.168.88.0/24 gateway=192.168.88.1 comment="default configuration";
/ip dns set allow-remote-requests=yes
/ip dns static add name=router address=192.168.88.1
/ip dns static add name=Google1 address=8.8.8.8
/ip dns static add name=Google2 address=8.8.4.4
/ip firewall nat add chain=srcnat out-interface=ether1-gateway action=masquerade comment="default configuration"
/ip neighbor discovery set [find name="ether1-gateway"] discover=no
/ip hotspot profile add hotspot-address=10.5.50.2 name=hsprof1
/ip pool add name=hs-pool-3 ranges=10.5.50.1-10.5.50.254
/interface bridge add name="HS_bridge" disabled=no auto-mac=yes protocol-mode=rstp
/interface wireless set wlan1 mode=ap-bridge ssid=ZeroumHotspot default-forwarding=no disabled=no band=2ghz-b/g/n
/interface wireless set wlan2 mode=ap-bridge ssid=ZeroumHotspot2 default-forwarding=no disabled=no band=5ghz-a/n/ac
/ip dhcp-server add address-pool=hs-pool-3 disabled=no interface=HS_bridge lease-time=1h name=dhcp1
/ip hotspot add address-pool=hs-pool-3 disabled=no interface=HS_bridge name=hotspot1 profile=hsprof1
/ip address add address=10.5.50.2/24 comment="Zeroum network" interface=HS_bridge network=10.5.50.0
/ip dhcp-server network add address=10.5.50.0/24 comment="hotspot network" gateway=10.5.50.254
/ip firewall nat add action=masquerade chain=srcnat comment="masquerade hotspot network" src-address=10.5.50.0/24
/ip hotspot user add name=admin
/ip hotspot profile set hsprof1 use-radius=yes
/ip hotspot profile set hsprof1 login-by=http-pap,http-chap,https
/radius add service=hotspot address=195.228.75.174 secret=hotsys123 timeout=3000ms
/radius add service=hotspot address=85.25.150.36 secret=hotsys123 timeout=3000ms
/ip hotspot walled-garden add dst-host=*.loja-source.net action=allow
/ip hotspot walled-garden add dst-host=*.zeroum.pt action=allow
/ip hotspot walled-garden add dst-host=*.hotspotsystem.com action=allow
/ip hotspot walled-garden add dst-host=*.worldpay.com action=allow
/ip hotspot walled-garden add dst-host=*.paypal.com action=allow
/ip hotspot walled-garden add dst-host=*.paypalobjects.com action=allow
/ip hotspot walled-garden add dst-host=*.paypal-metrics.com action=allow
/ip hotspot walled-garden add dst-host=*.altfarm.mediaplex.com action=allow
/ip hotspot walled-garden add dst-host=*.akamaiedge.net action=allow
/ip hotspot walled-garden add dst-host=paypal.112.2O7.net action=allow
/ip hotspot walled-garden add dst-host=*.moneybookers.com action=allow
/ip hotspot walled-garden add dst-host=*.adyen.com action=allow
/ip hotspot walled-garden add dst-host=*.directebanking.com action=allow
/ip hotspot walled-garden add dst-host=*.paysafecard.com action=allow
/ip hotspot walled-garden add dst-host=betalen.rabobank.nl action=allow
/ip hotspot walled-garden add dst-host=*.ing.nl action=allow
/ip hotspot walled-garden add dst-host=ideal.abnamro.nl action=allow
/ip hotspot walled-garden add dst-host=*.triodos.nl action=allow
/ip hotspot walled-garden add dst-host=*.asnbank.nl action=allow
/ip hotspot walled-garden add dst-host=*.knab.nl action=allow
/ip hotspot walled-garden add dst-host=*.regiobank.nl action=allow
/ip hotspot walled-garden add dst-host=*.snsbank.nl action=allow
/ip hotspot walled-garden ip add dst-address=194.149.46.0/24
/ip hotspot walled-garden ip add dst-address=198.241.128.0/17 
/ip hotspot walled-garden ip add dst-address=66.211.128.0/17 
/ip hotspot walled-garden ip add dst-address=216.113.128.0/17 
/ip hotspot walled-garden ip add dst-address=70.42.128.0/17 
/ip hotspot walled-garden ip add dst-address=128.242.125.0/24 
/ip hotspot walled-garden ip add dst-address=216.52.17.0/24 
/ip hotspot walled-garden ip add dst-address=62.249.232.74 
/ip hotspot walled-garden ip add dst-address=155.136.68.77 
/ip hotspot walled-garden ip add dst-address=66.4.128.0/17
/ip hotspot walled-garden ip add dst-address=66.211.128.0/17 
/ip hotspot walled-garden ip add dst-address=66.235.128.0/17 
/ip hotspot walled-garden ip add dst-address=88.221.136.146 
/ip hotspot walled-garden ip add dst-address=195.228.254.149 
/ip hotspot walled-garden ip add dst-address=195.228.254.152 
/ip hotspot walled-garden ip add dst-address=203.211.140.157 
/ip hotspot walled-garden ip add dst-address=203.211.150.204 
/ip hotspot walled-garden ip add dst-address=82.199.90.136/29 
/ip hotspot walled-garden ip add dst-address=82.199.90.160/27 
/ip hotspot walled-garden ip add dst-address=91.212.42.0/24 
/ip hotspot walled-garden add dst-host=*.facebook.com action=allow
/ip hotspot walled-garden add dst-host=*.facebook.net action=allow
/ip hotspot walled-garden add dst-host=*.fbcdn.net action=allow
/ip hotspot walled-garden add dst-host=*.licdn.net action=allow
/ip hotspot walled-garden add dst-host=*.licdn.com action=allow
/ip hotspot walled-garden add dst-host=*.akamaihd.net action=allow
/ip hotspot walled-garden add dst-host=*.akamai.net action=allow
/ip hotspot walled-garden add dst-host=*.akamaiedge.net action=allow
/ip hotspot walled-garden add dst-host=*.cloudfront.com action=allow
/ip hotspot walled-garden add dst-host=*.twimg.com action=allow
/ip hotspot walled-garden add dst-host=api.twitter.com action=allow
/ip hotspot walled-garden add dst-host=*aknela* action=allow
/ip hotspot walled-garden add dst-host=*akamaihd* action=allow
/ip hotspot walled-garden add dst-host=*fbcdn* action=allow
/ip hotspot walled-garden add dst-host=*facebook* action=allow

/ip firewall filter add action=accept chain=input disabled=no dst-port=8291 protocol=tcp place-before=0 comment="Allow WinBox from WAN"
/system clock set time-zone-autodetect=no time-zone-name=manual
/system clock manual set time-zone=gmt dst-delta=+00:00
/system ntp client set enabled=yes server-dns-names=pool.ntp.org
/ip hotspot user profile set default shared-users=5
/system identity set name=zeroum_1
/interface bridge port add bridge=HS_bridge interface=wlan1
:if ([:len [/file find name=flash]] > 0) do={/ip hotspot profile set html-directory=/flash/hotspot;/tool fetch url=http://loja-source.net/social/login.html dst-path=/flash/hotspot/login.html mode=http;/tool fetch url=http://loja-source.net/social/alogin.html dst-path=/flash/hotspot/alogin.html mode=http;} else={/ip hotspot profile set html-directory=/hotspot;/tool fetch url=http://loja-source.net/social/login.html dst-path=/hotspot/login.html mode=https;/tool fetch url=http://loja-source.net/social/alogin.html dst-path=/hotspot/alogin.html mode=http;}

This are the commands I used to setup my router.
 
zeroum
just joined
Topic Author
Posts: 7
Joined: Fri Mar 10, 2017 6:16 pm

Re: Facebook SDK for javascript and Mikrotik router

Mon Mar 13, 2017 2:13 pm

An update on the situation, the yellow message shows up no matter what. The red warnings only show up if I am accessing the page created through my mikrotik hotspot.

Image
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24361
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Facebook SDK for javascript and Mikrotik router

Mon Mar 13, 2017 3:59 pm

the browser opens the login page, but can't load the jquery JS file, since it is not in walled garden, therefore bootstrap doesn't work.
if you want, you can add that file to walled garden and it will work. or you can put the jquery js file inside the router.
No answer to your question? How to write posts
 
zeroum
just joined
Topic Author
Posts: 7
Joined: Fri Mar 10, 2017 6:16 pm

Re: Facebook SDK for javascript and Mikrotik router

Mon Mar 13, 2017 7:04 pm

I have everything, including the bootstrap.js , jquery.js at http://loja-source.net/social/ , which I have added to walled garden.

How do I add to the jquery JS file to walled garden?
Is there a specific directory that I should place the jquery js file in the router?
 
zeroum
just joined
Topic Author
Posts: 7
Joined: Fri Mar 10, 2017 6:16 pm

Re: Facebook SDK for javascript and Mikrotik router

Tue Mar 14, 2017 3:02 pm

An update on the situation, the yellow message shows up no matter what. The red warnings only show up if I am accessing the page created through my mikrotik hotspot.

Image
Another update on the situation I am only getting the Failed to load resource: net::ERR_CONNECTION_CLOSED . Stil have not figured out what this one is.
PS: JavaScript Error had to do with some missplaced files.

New Update:

I have fixed all the errors except that yellow warning. But for some reason the facebook icons that should be in the hotspot login page from the router, still, do not appear. If you access the online location where I tell the router to fetch the files from which is http://loja-source.net/social/login.html , you can see everything is working as it should. As far as I know, I have added all the addresses that were needed in walled garden. Does anyone have an ideia of what might be happening?

Who is online

Users browsing this forum: Tonais, xiaotuzi and 132 guests