## imcode.server.user
Class LdapUserAndRoleRegistry

    java.lang.Object
      imcode.server.user.LdapUserAndRoleRegistry

All Implemented Interfaces:
  Authenticator, UserAndRoleRegistry

    public class LdapUserAndRoleRegistry

extends java.lang.Object
implements Authenticator, UserAndRoleRegistry

The documentMapper maps LDAP attributes to Imcms internal user object. The default mapping uses the popular inetOrgPerson (2.16.840.1.113730.3.2.2) schema found in Netscape Directory Server
The inetOrgPerson is based on organizationalPerson (2.5.6.7) that is based on person (2.5.6.6) that is based on top (2.5.6.0)
See for example * @http://www.cio.ufl.edu/projects/directory/ldap-schema/oc-INETORGPERSON.html or @link http://ldap.akbkhome.com/objectclasstree/inetOrgPerson.html for details witch attributes that exists.

Field Summary
`static java.lang.String` `DEFAULT_LDAP_ROLE`

Constructor Summary
`LdapUserAndRoleRegistry(java.util.Properties ldapConfig)`
`LdapUserAndRoleRegistry(java.lang.String ldapUrl, java.lang.String ldapUserObjectClass, java.lang.String ldapUserName, java.lang.String ldapPassword, java.lang.String[] ldapAttributesMappedToRoles, java.util.Properties ldapUserAttributes)`

Method Summary
`boolean` `authenticate(java.lang.String loginName, java.lang.String password)`
`java.lang.String[]` `getAllRoleNames()`
`java.lang.String[]` `getRoleNames(UserDomainObject user)`
`UserDomainObject` `getUser(java.lang.String loginName)`
`void` `setUserPropertyLdapAttribute(java.lang.String userPropertyName, java.lang.String ldapAttribute)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_LDAP_ROLE

    public static final java.lang.String DEFAULT_LDAP_ROLE

See Also:
  Constant Field Values

Constructor Detail

### LdapUserAndRoleRegistry

    public LdapUserAndRoleRegistry(java.util.Properties ldapConfig)
                            throws com.imcode.net.ldap.LdapClientException

Throws:
  `com.imcode.net.ldap.LdapClientException`

### LdapUserAndRoleRegistry

    public LdapUserAndRoleRegistry(java.lang.String ldapUrl,
                                   java.lang.String ldapUserObjectClass,
                                   java.lang.String ldapUserName,
                                   java.lang.String ldapPassword,
                                   java.lang.String[] ldapAttributesMappedToRoles,
                                   java.util.Properties ldapUserAttributes)
                            throws com.imcode.net.ldap.LdapClientException

Parameters:
  `ldapUserAttributes` -
  `ldapUrl` - The full path to where the ldap-service is located _and_ the node where to start the searches, e.g. "ldap://computername:389/CN=Users,DC=companyName,DC=com"
  `ldapUserName` - A name that is used to log in (bind) to the ldap server
  `ldapPassword` - A password that i used to log in (bind) to the ldap server
Throws:
  `com.imcode.net.ldap.LdapClientException`

Method Detail

### getAllRoleNames

    public java.lang.String[] getAllRoleNames()

  Specified by:
    `getAllRoleNames` in interface `UserAndRoleRegistry`

### authenticate

    public boolean authenticate(java.lang.String loginName,
                                java.lang.String password)

  Specified by:
    `authenticate` in interface `Authenticator`

### getUser

    public UserDomainObject getUser(java.lang.String loginName)

  Specified by:
    `getUser` in interface `UserAndRoleRegistry`

### getRoleNames

    public java.lang.String[] getRoleNames(UserDomainObject user)

  Specified by:
    `getRoleNames` in interface `UserAndRoleRegistry`

### setUserPropertyLdapAttribute

    public void setUserPropertyLdapAttribute(java.lang.String userPropertyName,
                                             java.lang.String ldapAttribute)