I installed linotp2 on top of fresh Ubuntu 12.04 64-bit installation from launchpad. Then I downloaded rlm_linotp2 sources and created freeradius packages with make deb and installed necessary ones. At this point, I have a working installation of linotp2 with Apache. Added useridresolver using LDAPS and added a couple of TOTP tokens. Everything works as expected, I can authenticate to simplecheck url.
What I really want, is to have a challenge response authentication where the first step would be against AD (LDAPS connection) and then the server would sen challenge asking for (PIN+)OTP and after that user will be authenticated.
I found out that this is possible setting a couple of policies.
Here's what I have atm:
[OTP_PIN_variants]
realm = MYREALM
action = otppin=1
client = 192.168.222.0/24
user = *
time = ""
active = True
scope = authentication
[DetailsOnValidation]
realm = MYREALM
active = True
client = 192.168.222.0/24
user = *
time = ""
action = detail_on_fail
scope = authorization
[ChallengeResponse]
realm = MYREALM
active = True
client = 192.168.222.0/24
user = *
time = ""
action = challenge_response=HMAC TOTP PW
scope = authentication
If I have understood this correctly, the two policies (OTP_PIN_variants and ChallengeResponse) are the ones needed to achieve what I want to do.
Okay, I tested it with web browser entering the URL: https://mylinotpinstallation.com/validate/check?user=USERNAME&pass=PASSWORD
I get this:
{
"detail": {
"transactionid": "587491502871",
"message": "Please enter your otp value: ",
"error": "challenge created"
},
"version": "LinOTP 2.7",
"jsonrpc": "2.0",
"result": {
"status": true,
"value": false
},
"id": 0
}
Okay, then I respond to challenge like this:
https://mylinotpinstallation.com/validate/check?user=USERNAME&pass=467350&transactionid=587491502871
And it is a success:
{
"version": "LinOTP 2.7",
"jsonrpc": "2.0",
"result": {
"status": true,
"value": true
},
"id": 0
}
So it is working. Awesome!
Then to the problem. I have a Sonicwall firewall(s) and I use SSL-VPN feature. I have set up the authentication so that firewalls RADIUS client forwards username and password to FreeRADIUS which is running on the same machine as linotp2. FreeRADIUS gets username and password correctly but gets rejected:
Ready to process requests.
rad_recv: Access-Request packet from host 192.168.222.35 port 2585, id=0, length=62
User-Name = "USERNAME"
User-Password = "PASSWORD"
NAS-IP-Address = 192.168.222.35
NAS-Port = 0
# Executing section authorize from file /etc/freeradius/sites-enabled/linotp
+- entering group authorize {...}
++[preprocess] returns ok
++[chap] returns noop
++[mschap] returns noop
[suffix] No '@' in User-Name = "USERNAME", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
++[unix] returns notfound
[files] users: Matched entry DEFAULT at line 50
++[files] returns ok
++[expiration] returns noop
++[logintime] returns noop
[pap] WARNING! No "known good" password found for the user. Authentication may fail because of this.
++[pap] returns noop
Found Auth-Type = linotp2
# Executing group from file /etc/freeradius/sites-enabled/linotp
+- entering group authenticate {...}
rlm_linotp: getting client ip now.
got a IPv4 client address
found PW_PACKET_SRC_IP_ADDRESS
rlm_linotp: something
rlm_linotp: got client ip: 192.168.222.35.
rlm_linotp: Doing curl_easy_init
rlm_linotp: creating the URL.
entering createUrl4Post.
[0] user=USERNAME
[1] pass=PASSWORD
[2] client=192.168.222.35
allocating 57 chars
freeing escaped value for user
freeing escaped value for pass
freeing escaped value for client
rlm_linotp: LinOTPd on https://mylinotpinstallation.com/validate/check returned '{ "version": "LinOTP 2.7", "jsonrpc": "2.0", "result": { "status": true, "value": false }, "id": 0 }'
rlm_linotp: Rejecting fall-through 'USERNAME'
++[linotp2] returns reject
Failed to authenticate the user.
Using Post-Auth-Type Reject
# Executing group from file /etc/freeradius/sites-enabled/linotp
+- entering group REJECT {...}
[attr_filter.access_reject] expand: %{User-Name} -> USERNAME
attr_filter: Matched entry DEFAULT at line 11
++[attr_filter.access_reject] returns updated
Delaying reject of request 0 for 1 seconds
Going to the next request
Waking up in 0.9 seconds.
Sending delayed reject for request 0
Sending Access-Reject of id 0 to 192.168.222.35 port 2585
Waking up in 4.9 seconds.
Cleaning up request 0 ID 0 with timestamp +23
Ready to process requests.
Also I noticed that while my password is correct in rad_recv line, it is not correct in rlm_linotp line. I use dots and commas and at least comma is printed as %2C or ...? But I also tried with a password without special characters, didn't help.
linotp2 log doesn't show anything specially interesting other than this: [linotp.lib.token][finish_check_TokenList #1397] [__checkTokenList] user u'USERNAME'@u'MYREALM' failed to authenticate.
Thanks for your help!
- Lassi Kojo
But I cannot still authenticate:
rlm_linotp: LinOTPd on https://mylinotpinstallation.com/validate/check returned '{ "version": "LinOTP 2.7.0.2", "jsonrpc": "2.0", "result": { "status": true, "value": true }, "id": 0 }'
rlm_linotp: Rejecting fall-through 'USERNAME'
++[linotp2] returns reject
Failed to authenticate the user.
So even though LinOTP2 authenticates the user properly and gives success, it is a reject?
- Lassi