[RADIATOR] Radiator / LDAP / matching on multi-valued field

Dave Kitabjian dave at corp.netcarrier.com
Wed Feb 23 16:19:37 UTC 2022


Okay, thanks!

I'm not sure why the ones I tried didn't work, but your Idea #2 works great.

Thanks!

Dave

-----Original Message-----
From: radiator <radiator-bounces at lists.open.com.au> On Behalf Of Heikki Vatiainen
Sent: Wednesday, February 23, 2022 8:08 AM
To: radiator at lists.open.com.au
Subject: Re: [RADIATOR] Radiator / LDAP / matching on multi-valued field

On 22.2.2022 21.44, Dave Kitabjian wrote:
>>           PostSearchHook sub { my @hash = $_[4]->get('pager'); \
>>                  my @username = $_[4]->get('sAMAccountName'); \
>>                  system('/opt/radiator/radiator/goodies/inserttotp.sh', at username, at hash); \
>>                  return 1 ;}
>
> but the syntax eludes me. I tried:
>
>          main::log($main::LOG_DEBUG, "PostSearchHook: perform upsert to provision user", $p);\
>
> and also
>
>          $_[0]->log($main::LOG_DEBUG, "PostSearchHook: perform upsert to provision user", $p);\
>
> but neither works.
Most likely $p is not known above. Otherwise it looks good.

Below are a couple of ways to do it. I'd choose the second. $self, AKA
$_[0], refers to the AuthBy LDAP2 object that calls this hook. For this
reason the 1st and 2nd options do the same thing.

The 3rd goes through the global logger. This usually doesn't matter but
if you have configured something like this, then the message from the
1st log call wouldn't go to %L/auth-ldap-log

Trace 3
<AuthBy LDAP2>
   <Log FILE>
     Trace 4
     Filename %L/auth-ldap-log
   </Log>
   # ...
</AuthBy>

PostSearchHook sub { \
   $_[0]->log($main::LOG_DEBUG, "PostSearchHook1: perform upsert to
provision user", $_[2]);\

   my $self = $_[0]; my $p = $_[2]; \
   $self->log($main::LOG_DEBUG, "PostSearchHook2: perform upsert to
provision user", $p);\

   main::log($main::LOG_DEBUG, "PostSearchHook3: perform upsert to
provision user", $p);\

};


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://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.open.com.au%2Fmailman%2Flistinfo%2Fradiator&data=04%7C01%7Cdave%40corp.netcarrier.com%7C2a181a1fdb1b4359095508d9f6cdbb77%7C0cb89eef04a7465c893f447a3df63d9b%7C0%7C0%7C637812185739499054%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=esF3yMlTlph0kasVxlBUxRFjleS9gBLdEkW3zHoD4%2Fc%3D&reserved=0
CONFIDENTIALITY NOTICE***The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you.


More information about the radiator mailing list