after authentication page won't reload



  • Hello all,
    I'm trying to install and configure the spotipo (right now free, and if it's working we move to enterprise)...
    we have a guest wireless network that has it's own VLAN. inside this VLAN there's the spotipo server (ubuntu).
    the unifi controller (and all the unfi APs are in a different VLAN for security purpose).
    between the 2 vlans there's a nat rule that allow the guests to contact (in case) the ubiquiti controller.

    when I try to connect to the wireless, the spotipo page appears correctly. I compile the form (right now the email authentication).
    Once I've filled in all the fields and press the button, I got the thank you page but nothing more happens, even if I press the link "click here" nothing moves.
    what could it be?
    thank you very much in helping me...
    best regards
    Nicola



  • Hi NIcola,
    Please share a screenshot of the page where its is stopped so that we can further understand whats going on. Also share a log file of spotipo available at /usr/share/nginx/spotipo/logs/spotipo.log. Normally it would be redirecting to the configured page within few seconds.



  • Hi Sudheesh,
    thank you very much for your reply...
    first of all... I had to change the VLAN configuration because I think there are limitations on VLAN and Unifi Captive Portal...
    right now the guests accessing the same subnet of the controller... but if right now the native Unifi Controller works fine, the spotipo has the same issue...

    here you can find the log of the spotipo.log...

    [pid: 1374|app: 0|req: 174/270] 192.168.2.8 () {32 vars in 643 bytes} [Wed Feb 20 18:51:55 2019] GET /guest/s/hd8t17f7/?ap=fc:ec:da:b6:23:69&id=80:be:05:65:6e:cd&t=1550685116&url=http://captive.apple.com%2fhotspot-detect.html&ssid=Guests => generated 134 bytes in 1 msecs (HTTP/1.0 200) 2 headers in 80 bytes (1 switches on core 0)
    [pid: 1375|app: 0|req: 97/271] 192.168.2.8 () {46 vars in 1178 bytes} [Wed Feb 20 18:51:58 2019] GET /guest/s/hd8t17f7/?ap=fc:ec:da:b6:23:69&id=80:be:05:65:6e:cd&t=1550685118&url=http://www.swissminiatur.ch%2f&ssid=Guests => generated 305 bytes in 25 msecs (HTTP/1.1 302) 5 headers in 411 bytes (1 switches on core 0)
    DEBUG:flask.app:Wifiguest Log - Site ID:4 guestdevice MAC:80:be:05:65:6e:cd just visited http://192.168.1.1/unifi/auth/dd2d6ad4-6b66-42d0-bb8b-9731fa8002a3/
    DEBUG:flask.app:Siteid:4 guestrtrack:21 -Unifi AUTH DUR:59 UL:0 Dl:0 
    DEBUG:urllib3.util.retry:Converted retries value: 4 -> Retry(total=4, connect=None, read=None, redirect=None, status=None)
    DEBUG:urllib3.util.retry:Converted retries value: 4 -> Retry(total=4, connect=None, read=None, redirect=None, status=None)
    DEBUG:unifispot.modules.unifi.controller:Controller for https://localhost:8443/
    DEBUG:unifispot.modules.unifi.controller:_run_command(authorize-guest)
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): localhost
    /usr/share/nginx/spotipo/.env/lib/python2.7/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
      InsecureRequestWarning)
    DEBUG:urllib3.connectionpool:https://localhost:8443 "POST /api/s/hd8t17f7/cmd/stamgr HTTP/1.1" 403 62
    ERROR:unifispot.modules.unifi.controller:Error while trying to authorize guest:80:be:05:65:6e:cd                                 for controller:https://localhost:8443/
    Traceback (most recent call last):
      File "spotipo/unifispot/modules/unifi/controller.py", line 250, in authorize_guest
      File "spotipo/unifispot/modules/unifi/controller.py", line 215, in _run_command
      File "spotipo/unifispot/modules/unifi/controller.py", line 173, in _read
      File "/usr/share/nginx/spotipo/.env/lib/python2.7/site-packages/requests/models.py", line 940, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    HTTPError: 403 Client Error:  for url: https://localhost:8443/api/s/hd8t17f7/cmd/stamgr
    [pid: 1375|app: 0|req: 98/272] 192.168.2.8 () {46 vars in 1037 bytes} [Wed Feb 20 18:51:58 2019] GET /unifi/auth/dd2d6ad4-6b66-42d0-bb8b-9731fa8002a3/ => generated 11991 bytes in 95 msecs (HTTP/1.1 200) 4 headers in 331 bytes (1 switches on core 0)
    DEBUG:flask.app:Detected apple CNA, sending our ERROR response
    [pid: 1374|app: 0|req: 175/273] 192.168.2.8 () {32 vars in 643 bytes} [Wed Feb 20 18:51:58 2019] GET /guest/s/hd8t17f7/?ap=fc:ec:da:b6:23:69&id=80:be:05:65:6e:cd&t=1550685118&url=http://captive.apple.com%2fhotspot-detect.html&ssid=Guests => generated 134 bytes in 1 msecs (HTTP/1.0 200) 2 headers in 80 bytes (1 switches on core 0)
    [pid: 1374|app: 0|req: 176/274] 192.168.2.8 () {46 vars in 1178 bytes} [Wed Feb 20 18:52:02 2019] GET /guest/s/hd8t17f7/?ap=fc:ec:da:b6:23:69&id=80:be:05:65:6e:cd&t=1550685122&url=http://www.swissminiatur.ch%2f&ssid=Guests => generated 305 bytes in 20 msecs (HTTP/1.1 302) 5 headers in 411 bytes (1 switches on core 0)
    DEBUG:flask.app:Wifiguest Log - Site ID:4 guestdevice MAC:80:be:05:65:6e:cd just visited http://192.168.1.1/unifi/auth/dd2d6ad4-6b66-42d0-bb8b-9731fa8002a3/
    DEBUG:flask.app:Siteid:4 guestrtrack:21 -Unifi AUTH DUR:59 UL:0 Dl:0 
    DEBUG:urllib3.util.retry:Converted retries value: 4 -> Retry(total=4, connect=None, read=None, redirect=None, status=None)
    DEBUG:urllib3.util.retry:Converted retries value: 4 -> Retry(total=4, connect=None, read=None, redirect=None, status=None)
    DEBUG:unifispot.modules.unifi.controller:Controller for https://localhost:8443/
    DEBUG:unifispot.modules.unifi.controller:_run_command(authorize-guest)
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): localhost
    /usr/share/nginx/spotipo/.env/lib/python2.7/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
      InsecureRequestWarning)
    DEBUG:urllib3.connectionpool:https://localhost:8443 "POST /api/s/hd8t17f7/cmd/stamgr HTTP/1.1" 403 62
    ERROR:unifispot.modules.unifi.controller:Error while trying to authorize guest:80:be:05:65:6e:cd                                 for controller:https://localhost:8443/
    Traceback (most recent call last):
      File "spotipo/unifispot/modules/unifi/controller.py", line 250, in authorize_guest
      File "spotipo/unifispot/modules/unifi/controller.py", line 215, in _run_command
      File "spotipo/unifispot/modules/unifi/controller.py", line 173, in _read
      File "/usr/share/nginx/spotipo/.env/lib/python2.7/site-packages/requests/models.py", line 940, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    HTTPError: 403 Client Error:  for url: https://localhost:8443/api/s/hd8t17f7/cmd/stamgr
    [pid: 1374|app: 0|req: 177/275] 192.168.2.8 () {46 vars in 1037 bytes} [Wed Feb 20 18:52:02 2019] GET /unifi/auth/dd2d6ad4-6b66-42d0-bb8b-9731fa8002a3/ => generated 11991 bytes in 93 msecs (HTTP/1.1 200) 4 headers in 331 bytes (1 switches on core 0)
    DEBUG:flask.app:Detected apple CNA, sending our ERROR response
    [pid: 1374|app: 0|req: 178/276] 192.168.2.8 () {32 vars in 643 bytes} [Wed Feb 20 18:52:02 2019] GET /guest/s/hd8t17f7/?ap=fc:ec:da:b6:23:69&id=80:be:05:65:6e:cd&t=1550685123&url=http://captive.apple.com%2fhotspot-detect.html&ssid=Guests => generated 134 bytes in 1 msecs (HTTP/1.0 200) 2 headers in 80 bytes (1 switches on core 0)
    

    I notice there's an error on authorizing but I don't know why...
    thank you very much
    best regards
    Nicola



  • @Nicola-Schwendener This error looks like username/password issue with unifi controller.

    Have you configured unifi controller credentials properly in spotipo ?

    If yes which version of controller and spotipo are you using?



  • Hello @rakesh-mukundan thank you very much for your answer.
    I’m quite sure I used the correct username and password ... but I will try again!
    I, the latest software of unifi (5.10.17) and the lastest version of spotipo!
    But maybe my fault is to use the configuration of the guest portal in Unifi! Right now I selected “external portal” in unifi. Is it correct?
    Thank you very much!
    Best regards
    Nicola



  • @Nicola-Schwendener Only other possible explanation I have is the configured credentials doesn't have necessary privileges to authenticate devices. Is the configured user super user ?



  • Hello Rakesh,
    you were right. I gave the user a read-only permission... now it works correctly.
    but this is a must? or could I also grant a read only permission?
    best regards
    Nicola



  • @Nicola-Schwendener ofcourse this is a must for spotipo to authenticate devices


 

});