[RADIATOR] 2 Factor authentication via Authby LDAP2 and Authby OTP

Sagar Malam sagar.malam at ecosmob.com
Mon Jan 17 08:11:12 UTC 2022


Hello Heikki,

I need one more help. I would like to get a phone number from LDAP ( AD )
and use it in a challenge hook to send SMS to it.
I tried to set it  in auth by ldap2 :
AuthAttrDef phoneNumber, request

But it is not working for me. Am I doing it the right way ? Can you please
provide me some direction on this ?



On Mon, Jan 17, 2022 at 1:21 PM Sagar Malam <sagar.malam at ecosmob.com> wrote:

> This works exactly as expected. Thanks a lot Heikki.
>
> On Wed, Jan 12, 2022 at 11:32 PM Heikki Vatiainen <hvn at open.com.au> wrote:
>
>> A small update to the previous message to clarify the ChallengeHook a
>> little.
>>
>> On 10.1.2022 14.50, Sagar Malam wrote:
>>
>> > Thanks for the help. I worked as expected after doing corrections. I
>> > would like to have EAP support as well. Can you help me with enabling
>> > that  ?
>>
>> Please see below for a modifed version of the previous configuration.
>> Changes are:
>> - Add new global parameter that tells EAP to use State attribute
>> - Fix 'Identifier' spelling in AuthBy OTP
>> - Move State attribute to into the step where it's actually needed
>> - New Handler that takes care of EAP by converting EAP-GTC to PAP
>> - Updated <Handler State=auth-otp> to check that State ends with
>> 'auth-otp'
>> - Leave EAPType enabled only within AuthBy that processes EAP
>> - ConsumePassword is set to empty to clear the password before OTP
>>
>> Things to note: EAP-GTC is supported by converting it to PAP and then
>> doing the same steps that plain PAP would do. Some extra work is needed
>> to take care of State attribute that EAP also uses to track its state.
>>
>> With EAP the message payload is not encrypted unless the EAP method
>> itself does this. EAP-GTC does not. You can configure the following to
>> avoid exposing the static password to Radiator DEBUG level logging (the
>> parameter allows multiple attribute names too)
>>
>>    PacketDumpOmitAttributes EAP-Message,User-Password
>>
>> Care is also needed when EAP-GTC is transferred without secure tunneling
>> (EAP-TTLS, PEAP, IPsec, VPN or other method).
>>
>> PEAP and other, typically Wi-Fi, methods are not supported by the
>> configuration. I took a look at the current Laptop and Wireless EAP
>> clients but the PEAP/EAP-GTC or EAP-TTLS/EAP-GTC still seems to be rare.
>> OTPs also make frequent Wi-Fi (re)connects a bit troublesome to use.
>>
>> Here's the updated configuration. Please let us know how it goes.
>>
>>
>> EAP_UseState 1
>>
>> <AuthBy OTP>
>>      Identifier otp-authby
>>      PasswordPattern 99999
>>
>>      # Return undef from ChallengeHook to force reject if State
>>      # already ends with 'auth-otp'. Now it will send a new SMS
>>      # when empty string is entered by the end user.
>>      ChallengeHook sub {my ($self, $user, $p, $context) = @_;\
>>          $context->{otp_password} = $self->generate_password();\
>>          my $state = $p->get_attr('State'); \
>>          $p->{rp}->add_attr('State', 'auth-otp') \
>>              if !$state || $state !~ m/auth-otp\z/s; \
>>
>> system('/usr/src/send_sms.sh','NNNNNNNNN',$context->{otp_password});\
>>          return "OTP sent";}
>>
>>      VerifyHook sub {my ($self, $user, $submitted_pw, $p, $context) = @_;\
>>          return $context->{otp_password} eq $submitted_pw ;}
>> </AuthBy>
>>
>> <Handler ExistsInRequest=EAP-Message>
>>       <AuthBy FILE>
>>           EAPType GTC
>>           Filename /dev/null
>>           EAP_GTC_PAP_Convert
>>       </AuthBy>
>>
>>       # EAP adds State. It's permissible to add more,
>>       # such as AuthBy OTP State value, to the end.
>>       PostProcessingHook sub { my $rp = ${$_[1]}; \
>>            my @states = $rp->get_attr('State'); return if @states != 2; \
>>            $rp->delete_attr('State'); \
>>            $rp->add_attr('State', join('', reverse @states)); }
>> </Handler>
>>
>> <Handler State=/auth-otp\z/>
>>      AuthBy otp-authby
>> </Handler>
>>
>> <Handler>
>>      AuthByPolicy ContinueWhileAccept
>>      <AuthBy LDAP2>
>>          Host    192.168.0.45
>>          AuthDN CN=XXXXXX ,OU=ServiceAccounts,DC=XXXXX,DC=XXXXX,DC=com
>>          AuthPassword    XXXXX
>>          BaseDN        DC=XXXXXX,DC=XXXXX,DC=com
>>          ServerChecksPassword
>>          UsernameAttr sAMAccountName
>>          AuthAttrDef logonHours,MS-Login-Hours,check
>>          ConsumePassword
>>      </AuthBy>
>>      AuthBy otp-authby
>> </Handler>
>>
>>
>> Thanks,
>> Heikki
>>
>> --
>> Heikki Vatiainen
>> OSC, makers of Radiator
>> Visit radiatorsoftware.com for Radiator AAA server software
>> _______________________________________________
>> radiator mailing list
>> radiator at lists.open.com.au
>> https://lists.open.com.au/mailman/listinfo/radiator
>
>
>
> --
>
> Thanks & Regards,
> Sagar Malam
> Project Leader | Ecosmob Technologies Pvt. Ltd.
> (+91)9601533171 | www.ecosmob.com
> <http://www.google.com/url?q=http%3A%2F%2Fwww.hodusoft.com&sa=D&sntz=1&usg=AFQjCNHXhIaelhkmhqcPU8D1lt3QoYpm2w>
> Skype: sagar.ecosmob
>


-- 

Thanks & Regards,
Sagar Malam
Project Leader | Ecosmob Technologies Pvt. Ltd.
(+91)9601533171 | www.ecosmob.com
<http://www.google.com/url?q=http%3A%2F%2Fwww.hodusoft.com&sa=D&sntz=1&usg=AFQjCNHXhIaelhkmhqcPU8D1lt3QoYpm2w>
Skype: sagar.ecosmob

-- 
*Disclaimer*
In addition to generic Disclaimer which you have agreed on our 
website, any views or opinions presented in this email are solely those of 
the originator and do not necessarily represent those of the Company or its 
sister concerns. Any liability (in negligence, contract or otherwise) 
arising from any third party taking any action, or refraining from taking 
any action on the basis of any of the information contained in this email 
is hereby excluded.



*Confidentiality*
This communication (including any 
attachment/s) is intended only for the use of the addressee(s) and contains 
information that is PRIVILEGED AND CONFIDENTIAL. Unauthorized reading, 
dissemination, distribution, or copying of this communication is 
prohibited. Please inform originator if you have received it in error.


*Caution for viruses, malware etc.*
This communication, including any 
attachments, may not be free of viruses, trojans, similar or new 
contaminants/malware, interceptions or interference, and may not be 
compatible with your systems. You shall carry out virus/malware scanning on 
your own before opening any attachment to this e-mail. The sender of this 
e-mail and Company including its sister concerns shall not be liable for 
any damage that may incur to you as a result of viruses, incompleteness of 
this message, a delay in receipt of this message or any other computer 
problems. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.open.com.au/pipermail/radiator/attachments/20220117/a8eb93d2/attachment-0001.html>


More information about the radiator mailing list