<AuthBy LDAP2> module authenticates by
               issuing requests to an LDAP server. When the LDAP server replies, Radiator
               fetches a number of attributes and looks in them for the password, check
               items and reply items in order to authenticate the user. It does not log
               (but does reply to) accounting requests. You need to have a basic
               understanding of LDAP servers and databases in order to configure
               <AuthBy LDAP2>.<AuthBy LDAP2> module receives its
               first authentication request, it attempts to connect to the LDAP server
               specified by Host. Optionally you can authenticate Radiator as a valid
               user of the LDAP server by specifying AuthDN and
               AuthPassword. This is not the same thing as
               authenticating a user. It happens before authenticating a user, and proves
               that this radiusd is allowed to talk to the LDAP
               database.<AuthBy LDAP2> module tries then to
               fetch some attributes for the user. Specify the base DN to start looking
               in, and the attribute name with which to filter. Also specify the
               attributes that contain the password, and (optionally) the names of the
               attributes containing an encrypted password, RADIUS check items and RADIUS
               reply items. This scheme allows you to work with almost any LDAP schema.
               All you have to do is identify the right LDAP attribute names.<AuthBy LDAP2> module replies with an
               Access-Accept message containing all the attributes in the reply items
               attribute (if any). If the user does not appear in the LDAP database, or
               if any check attribute does not match, an Access-Reject message is sent to
               the client.<AuthBy LDAP2> modules do
               synchronous connections and searches. This can mean significant delays if
               your LDAP server is reached by a slow network connection, or your LDAP
               server is slow. In this case, consider putting the <AuthBy
                  LDAP2> realm in a sub-server, and having your main Radiator
               forward requests for that realm to the RADIUS sub-server.<AuthBy LDAP2> understands also the same
               parameters as <AuthBy xxxxxx>. For more
               information, see Section 3.32. <AuthBy xxxxxx>.<AuthBy LDAP2> together
                  with Microsoft Active Directory (AD), you may need to try the
                  following:ServerChecksPassword when the user must
                     be authenticated. AD does not provide password to LDAP. In this case,
                     do not use HoldserverConnection. For more
                     information, see Section 3.47.10. ServerChecksPassword.BaseDN empty if you use Global Catalog.
                     For more information, see Global Catalog and LDAP Searches  .
.AttrsWithBaseScope if you need to get a
                     constructed attribute, such as tokenGroups, for a
                     certain user. For more information, see Section 3.47.8. AttrsWithBaseScope.<AuthBy
                     LDAP2>, %0 is replaced by
                  UsernameAttr and %1 by the user
                  name.uid=username,ou=foo,o=bar,c=au:
                     BaseDN %0=%1,ou=foo,o=bar,c=au Scope base
(uid=name)
uid
                  is the name of the LDAP attribute defined by the
                  UsernameAttr parameter, and name
                  is the name of the user currently being authenticated. For advanced
                  applications, you can completely alter the search filter that Radiator
                  uses by using the optional SearchFilter parameter. It
                  allows you to use arbitrarily complicated LDAP search filters to select or
                  exclude users based on attributes other than their user name. Special
                  formatting characters are permitted, %0 is replaced by
                  UsernameAttr and %1 by the user
                  name. For example, this SearchFilter matches only
                  users with the appropriate setting of their ‘current’
                  attribute:SearchFilter (&(current=1)(uid=%1))
SearchFilter, you an use any special formatting
                  character. For backwards compatibility, Perl variables used to be
                  interpolated, but this has been removed. The default setting for
                  SearchFilter is (%0=%1), which
                  matches the user name against the LDAP attribute defined by the
                  UsernameAttr parameter (usually
                  uid). Therefore, the default search string is
                  (uid=name).{crypt}1xMKc0GIVUNbE,
                        {SHA}0DPiKuNIrrVmD8IUCuw1hQxNqZc= or
                     {SSHA}0DPiKuNIrrVmD8IUCuw1hQxNqZc= you should be using
                     PasswordAttr, not EncryptedPasswordAttr. Only use EncryptedPasswordAttr if
                     the your password are plain old Unix crypt format, like:
                     1xMKc0GIVUNbE.
                     # Get the encrypted password from cryptpw EncryptedPasswordAttr cryptpw
# Plaintext passwords. Gasp PasswordAttr passwd
# Use the uid attribute to match usernames UsernameAttr uid
AuthAttrDef is more general and useful than
                  CheckAttr and ReplyAttr, and
                  should be used in preference to them.AuthAttrDef parameters, one for each check or reply
                  attribute in your LDAP database. The general format is:AuthAttrDef ldapattributename[, radiusattributename, type[, formatted]]
ldapattributename is the name of the LDAP
                     attribute that is used as the check or reply item. If it is
                     multi-valued, and this is a check item, then Radiator permits a match
                     with any one of the values.radiusattributename is the name of the RADIUS
                     attribute that is used as the check or reply item. The special
                     radiusattributename ‘GENERIC’ indicates that it is a list of comma
                     separated attribute=value pairs, similar to ReplyAttr or
                     CheckAttr.type indicates whether it is a check or reply
                     item. It consists of the word “check” or the word “reply”. If type is
                     “request” the value is saved in the current request, from where it can
                     be later collected with a special formatting macro like:
                     %{attributename}.formatted indicates that the LDAP attributes are
                     to be subject to special character processing before being used.radiusattributename and
                     type fields are optional. If they are not specified, then
                     the ldapattributename attribute is fetched from LDAP, but
                     the fetched value of that attribute is not used. This can be helpful avoid
                     receiving all attributes from the server, or with for some types of LDAP
                     query where they can be used with PostSearchHook  .
.calledstationid, and use it as a check item against
                  the RADIUS Called-Station-IdAuthAttrDef calledstationid,Called-Station-Id,check
servicetype, and return the LDAP attribute
                  called address as a static IP address (after special
                  character replacements):AuthAttrDef servicetype,Service-Type,check AuthAttrDef address,Framed-IP-Address,reply,formatted
# Put poolhint attribute into the request: AuthAttrDef radiusUserPoolHint, X-userPoolHint, request # Put Group Name attribute into the Request: AuthAttrDef radiusSimultaneousUseGroupName,X-GroupName, request
fred        Group=%{X-GroupName}
            PoolHint=%{X-userPoolHint}
            callingstation LDAP
                  attribute that could be multi-valued, and into which you put all the
                  numbers the user was permitted to call from (as a separate value for each
                  number), then you would use:AuthAttrDef callingstation,Calling-Station-Id,check
PostSearchHook is called once for each LDAP result,
                  as governed by MaxRecords parameter. If there are no
                  results, the hook is not run. See Section 3.47.13. MaxRecords.PostSearchHook
                  has the following arguments:PostSearchHook:# this example for LDAP2 gets an additional attribute,
# multiplies it by 60 and uses it for Session-Timeout
# as a reply attribute for the user
PostSearchHook sub {my $attr = $_[4]->get('someldapattr');\
            $_[3]->get_reply->add_attr('Session-Timeout',\
            $attr * 60);}
               PostSearchHook, you also need to add this to the
                     <AuthBy LDAP> clause:
                     AuthAttrDef someldapattr
someldapattr
                        is the name of the LDAP attribute you are going to access in the
                        PostSearchHook.PasswordAttr parameter and
                  checks the password internally. This optional parameter causes the LDAP
                  server to check the password instead. This is useful with LDAP servers
                  that implement proprietary encryption algorithms in their passwords, or do
                  not provide access to password attribute. For example, Microsoft Active
                  Directory does not provide read access to password information over
                  LDAP.ServerChecksPassword is specified,
                  the password checking is performed using an LDAP bind
                  operation.ServerChecksPassword:# We are using Active Directory ServerChecksPassword
ServerChecksPassword is compatible
                     with PAP, EAP-TTLS/PAP, and other authentication methods that provide a
                     plain text password. ServerChecksPassword does not
                     work with CHAP, MSCHAP, and most EAP methods since these do not provide a
                     password Radiator can use with an LDAP bind operation.
                     ServerChecksPassword with
                     HoldServerConnection may cause failure situations.
                     This is due to some LDAP servers' behaviour when the password check fails
                     but the connection is not closed. A failure situation may also occur when
                     the password check succeeds but the user is not allowed to perform
                     searches in the server. If your users experience unexpected authentication
                     failures, try testing your system without using these 2 parameters
                     together. goodies/edirectory.txt for more details
                  about how to install and configure eDirectory so that Radiator can use
                  GetNovellUP successfully.# Check the radius items in checkitems CheckAttr checkitems
# Reply with all the items in replyitems ReplyAttr replyitems