org.romaframework.module.users
Class LdapAuthentication

java.lang.Object
  extended by org.romaframework.core.config.Configurable<T>
      extended by org.romaframework.core.module.SelfRegistrantConfigurableModule<java.lang.String>
          extended by org.romaframework.aspect.authentication.AuthenticationAspectAbstract
              extended by org.romaframework.module.users.UsersAuthentication
                  extended by org.romaframework.module.users.LdapAuthentication
All Implemented Interfaces:
org.romaframework.aspect.authentication.AuthenticationAspect, org.romaframework.aspect.authentication.UserObjectPermissionListener, org.romaframework.aspect.session.SessionListener, org.romaframework.core.aspect.Aspect, org.romaframework.core.config.Serviceable, org.romaframework.core.flow.SchemaFieldListener, org.romaframework.core.module.Module

public class LdapAuthentication
extends UsersAuthentication

LDAP implementation of the authentication aspect. Allows to use an LDAP (or ActiveDirectory) server for authentication.
To replace the default implementation of AuthenticationAspect with this implementation you have to modify "applicationContext-core.xml" and replace the bean named "AuthenticationAspect" with the following:

<bean id="AuthenticationAspect" class="org.romaframework.module.users.LdapAuthentication" singleton="true">
<property name="domain" value="<domain-name>" />
 <property name="ldapHost" value="ldap://<host-name>" />
  <property name="searchBase" value="your AD root, e.g. dc=mydomain,dc=org" />
 <property name="singleSessionPerUser" value="false" />
 <property name="accountBinder">
  <bean class="org.romaframework.module.users.SimpleAccountBinder"/>
  <!-- override this for a new strategy of binding an LDAP account to a BaseAccount -->
 </property>
</bean>

Author:
Luigi Dell'Aquila

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.romaframework.core.flow.SchemaFieldListener
org.romaframework.core.flow.SchemaFieldListener.IgnoredExecution
 
Field Summary
 
Fields inherited from class org.romaframework.module.users.UsersAuthentication
ANONYMOUS_PROFILE_NAME, PAR_ALGORITHM
 
Fields inherited from class org.romaframework.aspect.authentication.AuthenticationAspectAbstract
DEF_ALGORITHM
 
Fields inherited from class org.romaframework.core.config.Configurable
DEFAULT_CONFIG
 
Fields inherited from interface org.romaframework.core.flow.SchemaFieldListener
IGNORED
 
Fields inherited from interface org.romaframework.aspect.authentication.AuthenticationAspect
ASPECT_NAME
 
Fields inherited from interface org.romaframework.core.config.Serviceable
STATUS_DOWN, STATUS_SHUTDOWNING, STATUS_STARTING, STATUS_UNKNOWN, STATUS_UP
 
Constructor Summary
LdapAuthentication()
           
 
Method Summary
 java.lang.Object authenticate(java.lang.String iUserName, java.lang.String iUserPasswd, java.util.Map<java.lang.String,java.lang.String> iParameters)
           
 AccountBinder getAccountBinder()
           
 java.lang.String getDomain()
           
 java.lang.String getLdapHost()
           
 java.util.List<java.lang.String> getNonLdapUsers()
           
 java.util.List<java.lang.String> getReturnedAttributes()
           
 java.lang.String getSearchBase()
           
 void setAccountBinder(AccountBinder accountBinder)
           
 void setDomain(java.lang.String domain)
           
 void setLdapHost(java.lang.String ldapHost)
           
 void setNonLdapUsers(java.util.List<java.lang.String> nonLdapUsers)
           
 void setReturnedAttributes(java.util.List<java.lang.String> returnedAttributes)
           
 void setSearchBase(java.lang.String searchBase)
           
 
Methods inherited from class org.romaframework.module.users.UsersAuthentication
allow, allowAction, allowClass, allowEvent, allowField, checkPassword, getCurrentProfile, isSingleSessionPerUser, logout, onAfterFieldRead, onAfterFieldWrite, onBeforeFieldRead, onBeforeFieldWrite, onSessionCreating, onSessionDestroying, setSingleSessionPerUser, startup
 
Methods inherited from class org.romaframework.aspect.authentication.AuthenticationAspectAbstract
aspectName, beginConfigClass, configAction, configClass, configEvent, configField, encryptPassword, encryptPasswordInBytes, endConfigClass, getCurrentAccount, getEncryptionAlgorithm, getUnderlyingComponent, setEncryptionAlgorithm
 
Methods inherited from class org.romaframework.core.module.SelfRegistrantConfigurableModule
getStatus, moduleName, showConfiguration, shutdown
 
Methods inherited from class org.romaframework.core.config.Configurable
addConfiguration, addConfiguration, getConfiguration, getConfigurationValues, setConfiguration
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapAuthentication

public LdapAuthentication()
Method Detail

authenticate

public java.lang.Object authenticate(java.lang.String iUserName,
                                     java.lang.String iUserPasswd,
                                     java.util.Map<java.lang.String,java.lang.String> iParameters)
                              throws org.romaframework.aspect.authentication.AuthenticationException
Specified by:
authenticate in interface org.romaframework.aspect.authentication.AuthenticationAspect
Overrides:
authenticate in class UsersAuthentication
Throws:
org.romaframework.aspect.authentication.AuthenticationException

getAccountBinder

public AccountBinder getAccountBinder()

setAccountBinder

public void setAccountBinder(AccountBinder accountBinder)

getDomain

public java.lang.String getDomain()

setDomain

public void setDomain(java.lang.String domain)

getLdapHost

public java.lang.String getLdapHost()

setLdapHost

public void setLdapHost(java.lang.String ldapHost)

getSearchBase

public java.lang.String getSearchBase()

setSearchBase

public void setSearchBase(java.lang.String searchBase)

getReturnedAttributes

public java.util.List<java.lang.String> getReturnedAttributes()

setReturnedAttributes

public void setReturnedAttributes(java.util.List<java.lang.String> returnedAttributes)

getNonLdapUsers

public java.util.List<java.lang.String> getNonLdapUsers()

setNonLdapUsers

public void setNonLdapUsers(java.util.List<java.lang.String> nonLdapUsers)