OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: dotslasher on January 31, 2022, 11:28:15 pm

Title: Captive portal not working (login accepted but logged out immediately)
Post by: dotslasher on January 31, 2022, 11:28:15 pm
So I've setup the captive portal, added all allow rules for DNS, Captive Portal and connections from the Guest network to the outside world.

I'm using Unifi for my Wifi, changed the Wifi settings for the Unifi Guest settings to the captive portal of Opnsense.
I connect to the Guest wifi with my iphone and macbook and I'm greeted with a nice Opnsense captive portal login.

When I input the correct credentials I'm greeted with the same login screen except no error message or success message appears.
When I input the wrong credentials, the portal tells me they're wrong.

When I check the logs I see the following:

Code: [Select]
2022-01-31T22:58:49 Error audit /index.php: User logged out for user 'guest' from: 192.168.10.46
2022-01-31T22:58:49 Error audit /index.php: Successful login for user 'guest' from: 192.168.10.46
2022-01-31T22:58:49 Notice audit user guest authenticated successfully for WebGui [using OPNsense\Auth\Services\WebGui + OPNsense\Auth\Local]

In the General log file I see the following:

Code: [Select]
/index.php: guest@192.168.10.46 attempted to access / but does not have access to that page. Redirecting to index.php?logout.

I've tested a few things:

If I allow the Guest group to access /* then I get the error: File not found.
I tested by allowing the Guest group to access the Captive portal Gui (just for testing purposes) and this gave me the Portal Gui configuration page.
But I can't get it to login and stay connected as it should.