Captive Portal Error
-
@gertjan said in Captive Portal Error:
With
filesin place,
your
if ((notfound || noop) && ("%{%{Control:Auth-Type}:-No-Accept}" != "Accept"))yields a "FALSE, so the 'sql' block isn't executed.
(that what I make of it).This is correct because it finds the "test" user in the
files
backend.
It checksfiles
,sql
andldap
backends sequentially.Redmine issue created: https://redmine.pfsense.org/issues/11388
-
@viktor_g said in Captive Portal Error:
This is correct because it finds the "test" user in the files backend.
I did not (do not) have a 'test' user set up in the pfSense GUI - only in the 'radcheck' MYSQL table.
Done on purpose, to see if the auth would fall through to 'radcheck testing' if no result was found in the 'files' (pfSense GUI).
-
@gertjan in this case it should bypass
files
backend,
my test (raduser1
inldap
backend,test1
user infiles
backend) with this patch:raduser1 (ldap):
(0) eap: No EAP-Message, not doing EAP (0) [eap] = noop (0) [files] = noop (0) if ((notfound || noop) && ("%{%{Control:Auth-Type}:-No-Accept}" != "Accept")) { (0) EXPAND %{%{Control:Auth-Type}:-No-Accept} (0) --> No-Accept (0) if ((notfound || noop) && ("%{%{Control:Auth-Type}:-No-Accept}" != "Accept")) -> TRUE (0) if ((notfound || noop) && ("%{%{Control:Auth-Type}:-No-Accept}" != "Accept")) { (0) if (true) { (0) if (true) -> TRUE (0) if (true) { (0) redundant { rlm_ldap (ldap): 0 of 0 connections in use. You may need to increase "spare" rlm_ldap (ldap): Opening additional connection (0), 1 of 5 pending slots used rlm_ldap (ldap): Connecting to ldap://192.168.88.91:389 rlm_ldap (ldap): Waiting for bind result... rlm_ldap (ldap): Bind successful rlm_ldap (ldap): Reserved connection (0) (0) ldap: EXPAND (uid=%{%{Stripped-User-Name}:-%{User-Name}}) (0) ldap: --> (uid=raduser1) (0) ldap: Performing search in "cn=accounts,dc=pand,dc=int" with filter "(uid=raduser1)", scope "sub" (0) ldap: Waiting for search result... (0) ldap: User object found at DN "uid=raduser1,cn=users,cn=accounts,dc=pand,dc=int" (0) ldap: Processing user attributes (0) ldap: WARNING: No "known good" password added. Ensure the admin user has permission to read the password attribute (0) ldap: WARNING: PAP authentication will *NOT* work with Active Directory (if that is what you were trying to configure) rlm_ldap (ldap): Released connection (0) Need 4 more connections to reach min connections (5) rlm_ldap (ldap): Opening additional connection (1), 1 of 4 pending slots used rlm_ldap (ldap): Connecting to ldap://192.168.88.91:389 rlm_ldap (ldap): Waiting for bind result... rlm_ldap (ldap): Bind successful (0) [ldap] = ok
test1 (files):
1) eap: No EAP-Message, not doing EAP (1) [eap] = noop (1) files: users: Matched entry test1 at line 2 (1) [files] = ok (1) if ((notfound || noop) && ("%{%{Control:Auth-Type}:-No-Accept}" != "Accept")) { (1) if ((notfound || noop) && ("%{%{Control:Auth-Type}:-No-Accept}" != "Accept")) -> FALSE rlm_counter: Entering module authorize code rlm_counter: Could not find Check item value pair (1) [daily] = noop rlm_counter: Entering module authorize code rlm_counter: Could not find Check item value pair (1) [weekly] = noop rlm_counter: Entering module authorize code rlm_counter: Could not find Check item value pair (1) [monthly] = noop rlm_counter: Entering module authorize code rlm_counter: Could not find Check item value pair (1) [forever] = noop (1) if (&request:Calling-Station-Id == &control:Calling-Station-Id) { (1) ERROR: Failed retrieving values required to evaluate condition (1) [expiration] = noop (1) [logintime] = noop (1) [pap] = updated (1) } # authorize = updated
-
-
@gertjan Yes, but it uses the same logic (see
/usr/local/etc/raddb/sites-enabled/default
)files
+ldap
:if ((notfound || noop) && ("%{%{Control:Auth-Type}:-No-Accept}" != "Accept")) { ### sql DISABLED ### if (true) { redundant { ldap # this line adds ldap2 when activated ### ldap2 disabled ### } if (notfound || noop) { reject } } }
files
+sql
:if ((notfound || noop) && ("%{%{Control:Auth-Type}:-No-Accept}" != "Accept")) { redundant sql { sql1 ### sql2 DISABLED ### } if (notfound || noop) { ### ldap ### if (notfound || noop) { reject } } }
-
@viktor_g Already tested this, Its working just fine with no errors
-
-
@viktor_g Thanks, this fix works. Cheers to you.
-
I confirm.
I was doing stupid things .... the correction proposed works very well.
@viktor_g : -
Will be in the next FreeRADIUS pkg update (0.15.7_28)