|
NAMEConnector::Builtin::Authentication::LDAPDESCRIPTIONConnector (see perldoc Connector) to authenticate users against LDAP. Supports simple authentication (via LDAP bind), SASL authentication is not supported.The module allows for direct bind or indirect bind (with preliminary user search). Direct bind is the most straightforward method, but it requires users to know their Distinguished Names (DNs) in LDAP. Indirect bind is more convenient for users, but it involves LDAP database search, which requires read access to larger parts of LDAP directory (so LDAP ACLs must be set properly to allow indirect bind). The module implements group participation checking. With this option enabled, only users that belong to a predefined group may pass the authentication. The group is stored in LDAP directory (it may be for example an entry of type groupOfUniqueNames with the group participants listed in attribute uniqueMember). When requesting indirect bind, the internal user search may return multiple DNs. By default this is treated as an error (because of ambiguity) and results with authentication failure. This may be changed by setting a parameter named ambiguous, in which case the module will try to consecutively bind to each DN from the search result. The indirect bind may be configured to use custom search filter, instead of the default one. This allows to incorporate additional restrictions on users based on their attributes stored in LDAP. UsageThe username is the first component of the path, the password needs to be passed in the extended parameters using the key password.Example: $connector->get('username', { password => 'mySecret' } ); To configure module for direct bind, the connector object should be created with parameter indirect => 0. This is the simplest authentication method and requires least parameters to be configured. Example: my $connector = Connector::Builtin::Authentication::LDAP->new({ LOCATION => 'ldap://ldap.example.org', indirect => 0 }) my $result = $connector->get( 'uid=jsmith,ou=people,dc=example,dc=org', { password => 'secret' } ); Indirect bind, which is default, searches through the LDAP directory. This usually requires read access to database, and is performed by a separate user. We'll call that user binddn. For indirect-bind authentication, one usually has to provide DN and password of the existing binddn user. Example: my $connector = Connector::Builtin::Authentication::LDAP->new({ LOCATION => 'ldap://ldap.example.org', binddn => 'cn=admin,dc=example,dc=org', password => 'binddnPassword' }) my $result = $connector->get('jsmith', { password => 'secret' }); Two parameters are used to check group participation: groupdn and groupattr. The groupdn parameter specifies DN of a group entry and the groupattr specifies an attribute of the groupdn object where group participants are listed. If you specify groupdn, the group participation check is enabled. Example: # Assume, we have in LDAP: # # dn: cn=vip,dc=example,dc=org # objectClass: groupOfNames # member: uid=jsmith,ou=people,dc=example,dc=org # my $connector = Connector::Builtin::Authentication::LDAP->new({ LOCATION => 'ldap://ldap.example.org', indirect => 0, binddn => 'cn=admin,dc=example,dc=org', password => 'binddnPassword', groupdn => 'cn=vip,dc=example,dc=org', }) my $result = $connector->get( 'uid=jsmith,ou=people,dc=example,dc=org', { password => 'secret' } ); Note, that in this case we have provided binddn despite the direct-bind authentication was used. This is, because we needed read access to the "cn=vip,dc=example,dc=org" entry (the group object). The indirect-bind method accepts custom filters for user search. Example: my $connector = Connector::Builtin::Authentication::LDAP->new({ LOCATION => 'ldap://ldap.example.org', binddn => 'cn=admin,dc=example,dc=org', password => 'binddnPassword', filter => '(&(uid=[% LOGIN %])(accountStatus=active))' }) my $result = $connector->get('jsmith', { password => 'secret' }); You may substitute user name by using [% LOGIN %] template parameter, as shown in the above example. ConfigurationBelow is the full list of configuration options.Connection options See Connector::Proxy::Net::LDAP SSL Connection options
BindDN
Search options (indirect bind)
Other options
Return valuesReturns the DN of the matched entry, 0 if the user is found but the password does not match and undef if the user is not found (or it's found but group check failed).LimitationsUser names are limited to so called valueencoding syntax defined by RFC4515. We allow non-ascii (utf-8) characters and non-printable characters. Invalid names are treated as not found.
Visit the GSP FreeBSD Man Page Interface. |