Hello!
I have an issue geting authenticate on system(my case is pam system) via PrivacyIdea.
I have test and prod instance of Pidea - the same version(3.8.1), FreeRADIUS Version 3.0.26
When I try to authenticate via Pidea on my prod env I get such log in freeradius.log:
Prod pidea reject:
Thu May 4 11:53:53 2023 : Info: rlm_perl: Config File /etc/privacyidea/rlm_perl.ini found!
Thu May 4 11:53:53 2023 : Info: rlm_perl: Debugging config:
Thu May 4 11:53:53 2023 : Info: rlm_perl: Default URL https://localhost/validate/check
Thu May 4 11:53:53 2023 : Info: rlm_perl: Looking for config for auth-type Perl
Thu May 4 11:53:53 2023 : Info: rlm_perl: Could not find valid password encoding. Sending password as-is.
Thu May 4 11:53:53 2023 : rlm_perl: No appropriate encodings found!
Thu May 4 11:53:53 2023 : Info: rlm_perl: Setting client IP to 10.*.*.*.
Thu May 4 11:53:53 2023 : Info: rlm_perl: Auth-Type: Perl
Thu May 4 11:53:53 2023 : Info: rlm_perl: url: https://localhost/validate/check
Thu May 4 11:53:53 2023 : Info: rlm_perl: user sent to privacyidea: MYUSER
Thu May 4 11:53:53 2023 : Info: rlm_perl: realm sent to privacyidea:
Thu May 4 11:53:53 2023 : Info: rlm_perl: resolver sent to privacyidea:
Thu May 4 11:53:53 2023 : Info: rlm_perl: client sent to privacyidea: 10.*.*.*
Thu May 4 11:53:53 2023 : Info: rlm_perl: state sent to privacyidea:
Thu May 4 11:53:53 2023 : Info: rlm_perl: urlparam client
Thu May 4 11:53:53 2023 : Info: rlm_perl: urlparam user
Thu May 4 11:53:53 2023 : Info: rlm_perl: urlparam pass
Thu May 4 11:53:53 2023 : Info: rlm_perl: Request timeout: 10
Thu May 4 11:53:53 2023 : Info: rlm_perl: Not verifying SSL certificate!
Thu May 4 11:53:54 2023 : Info: rlm_perl: elapsed time for privacyidea call: 0.561893
Thu May 4 11:53:54 2023 : Info: rlm_perl: privacyIDEA Result status is true!
Thu May 4 11:53:54 2023 : Info: rlm_perl: privacyIDEA access denied for MYUSERrealm=''
Thu May 4 11:53:54 2023 : Info: rlm_perl: return RLM_MODULE_REJECT
When I try to authenticate via my test Pidea, everything works fine:
Test pidea access:
Fri May 5 09:46:19 2023 : Info: rlm_perl: Config File /etc/privacyidea/rlm_perl.ini found!
Fri May 5 09:46:19 2023 : Info: rlm_perl: Debugging config:
Fri May 5 09:46:19 2023 : Info: rlm_perl: Default URL https://localhost/validate/check
Fri May 5 09:46:19 2023 : Info: rlm_perl: Looking for config for auth-type Perl
Fri May 5 09:46:19 2023 : Info: rlm_perl: Password encoding guessed: ascii
Fri May 5 09:46:19 2023 : Info: rlm_perl: Setting client IP to 10.*.*.*.
Fri May 5 09:46:19 2023 : Info: rlm_perl: Auth-Type: Perl
Fri May 5 09:46:19 2023 : Info: rlm_perl: url: https://localhost/validate/check
Fri May 5 09:46:19 2023 : Info: rlm_perl: user sent to privacyidea: MYUSER
Fri May 5 09:46:19 2023 : Info: rlm_perl: realm sent to privacyidea:
Fri May 5 09:46:19 2023 : Info: rlm_perl: resolver sent to privacyidea:
Fri May 5 09:46:19 2023 : Info: rlm_perl: client sent to privacyidea: 10.*.*.*
Fri May 5 09:46:19 2023 : Info: rlm_perl: state sent to privacyidea:
Fri May 5 09:46:19 2023 : Info: rlm_perl: urlparam client
Fri May 5 09:46:19 2023 : Info: rlm_perl: urlparam pass
Fri May 5 09:46:19 2023 : Info: rlm_perl: urlparam user
Fri May 5 09:46:20 2023 : Info: rlm_perl: Request timeout: 10
Fri May 5 09:46:20 2023 : Info: rlm_perl: Not verifying SSL certificate!
Fri May 5 09:46:22 2023 : Info: rlm_perl: elapsed time for privacyidea call: 2.236184
Fri May 5 09:46:22 2023 : Info: rlm_perl: privacyIDEA Result status is true!
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++ Parsing group: Attribute
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++ Found member 'Attribute Filter-Id'
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++ Attribute: IF ''->'' == '' THEN 'Filter-Id'
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++ no directory
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++++ User attribute is a string:
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++++ trying to match
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++++ Result: No match, no RADIUS attribute Filter-Id added.
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++ Found member 'Attribute otherAttribute'
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++ Attribute: IF ''->'' == '' THEN 'otherAttribute'
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++ no directory
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++++ User attribute is a string:
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++++ trying to match
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++++ Result: No match, no RADIUS attribute otherAttribute added.
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++ Found member 'Attribute Filter-ID'
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++ Attribute: IF 'user'->'Fortinet-Group-Name' == 'CN=(\S+_OTP)' THEN 'Filter-ID'
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++ searching in directory user
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++++ User attribute is a string:
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++++ trying to match
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++++ Result: No match, no RADIUS attribute Filter-ID added.
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++ Found member 'Attribute Fortinet-Group-Name'
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++ Attribute: IF 'user'->'memberOf' == 'CN=(\S+_OTP)' THEN 'Fortinet-Group-Name'
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++ searching in directory user
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++++ User attribute is a string:
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++++ trying to match
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++++ Result: No match, no RADIUS attribute Fortinet-Group-Name added.
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++ Found member 'Attribute Class'
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++ Attribute: IF ''->'' == '' THEN 'Class'
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++ no directory
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++++ User attribute is a string:
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++++ trying to match
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++++ Result: No match, no RADIUS attribute Class added.
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++ Parsing group: Mapping
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++++ Found member 'Mapping user'
Fri May 5 09:46:22 2023 : Info: rlm_perl: ++++++ Map: user : group -> Class
Fri May 5 09:46:22 2023 : Info: rlm_perl: +++ Map: serial -> privacyIDEA-Serial
Fri May 5 09:46:22 2023 : Info: rlm_perl: return RLM_MODULE_HANDLED
Looks that problem is in this:
...
Thu May 4 11:53:53 2023 : Info: rlm_perl: Looking for config for auth-type Perl
Thu May 4 11:53:53 2023 : Info: rlm_perl: Could not find valid password encoding. Sending password as-is.
Thu May 4 11:53:53 2023 : rlm_perl: No appropriate encodings found!
...
On my test it looks like this:
...
Fri May 5 09:42:11 2023 : Info: rlm_perl: Looking for config for auth-type Perl
Fri May 5 09:42:11 2023 : Info: rlm_perl: Password encoding guessed: ascii
...
I’ve got encodings list using this code:
#!/usr/bin/env perl
use Encode;
@list = Encode->encodings();
print @list
My prod Pidea:
asciiascii-ctrlcp1252iso-8859-1nullutf-8-strictutf8
My test Pidea:
asciiascii-ctrlcp1252iso-8859-1nullutf-8-strictutf8
Also I’ve noticed the order of urlparam:
My prod:
Thu May 4 11:53:53 2023 : Info: rlm_perl: urlparam client
Thu May 4 11:53:53 2023 : Info: rlm_perl: urlparam user
Thu May 4 11:53:53 2023 : Info: rlm_perl: urlparam pass
My test:
Fri May 5 09:42:11 2023 : Info: rlm_perl: urlparam client
Fri May 5 09:42:11 2023 : Info: rlm_perl: urlparam pass
Fri May 5 09:42:11 2023 : Info: rlm_perl: urlparam user
Any clues, please?
P.S. Also I’ve figured out that password for my Pidea Prod is sent like:
??d??4??r?9?v???
OR
??V?ͭ???�!prV#
While on Pidea Test I’ve got plain text password.
Also my Pidea Prod use https, while Pidea Test has no ssl cert.
Though other systems use Pidea Prod normally(also got plaintext password in $password variable of vim /usr/share/privacyidea/freeradius/privacyidea_radius.pm).