org.jboss.security.idm.ldap
Class LDAPIdentityProvider

java.lang.Object
  extended by org.jboss.security.idm.ldap.LDAPIdentityProvider
All Implemented Interfaces:
LoginProvider, ProvisioningProvider

public class LDAPIdentityProvider
extends java.lang.Object
implements ProvisioningProvider

LDAPIdentityProvider is a built-in implementation of a ProvisioningProvider/LoginProvider that accessed data stored in an LDAP repository

This implementation supports the following standard LDAP schemas:
User Identity Information stored in InetOrgPerson schema
Role Information stored in GroupOfUniqueNames schema
At this time, this implementation is tested to work with OpenLDAP and RedHat Directory Server.

Author:
Sohil Shah - sohil.shah@jboss.com - May 30, 2006

Constructor Summary
LDAPIdentityProvider()
           
 
Method Summary
 void activate(Identity identity)
          Activates a user account
 void activate(java.lang.String username)
          Activates a user account
 void addRole(Role role)
          Adds a new role to the system
 void deactivate(Identity identity)
          Deactivates a user account
 void deactivate(java.lang.String username)
          Deactivates a user account
 boolean exists(java.security.Principal principal)
          Checks if the specified Principal exists in the system anymore or not
 boolean exists(Role role)
          Checks if the specified role exists in the system
 boolean exists(java.lang.String username)
          Checks if the specified username exists in the system anymore or not
 java.lang.String getId()
          Returns an id that uniquely identifies the LoginProvider plugged into the JBoss SSO system.
 boolean login(java.security.Principal principal, byte[] password)
          Checks if the specified Principal should successfully authenticated using the specified password
 boolean login(java.lang.String username, byte[] password)
          Checks if the specified username should be successfully authenticated using the specified password
 void processSSOLoginNotification(LoginContext loginContext)
          This notification is received from the SSO Engine when the engine performs an automatic logic based on a trusted assertion received from a partner site.
 Identity read(java.security.Principal principal)
          Returns the Identity data for the specified Principal
 Identity read(java.lang.String username)
          Returns the Identity data for the specified username
 java.util.Collection readAllRoles()
          Return all the authorization roles registered in the system.
 Role readRole(java.lang.String roleName)
          Reads role information for the specified role name
 void register(Identity identity)
          Registers a new user into the system
 void remove(Identity identity)
          Removes a user from the system
 void remove(java.lang.String username)
          Removes a user from the system
 void removeRole(Role role)
          Removes a role from the system
 void resetPassword(java.lang.String username, byte[] password)
          Resets the password of the specified user
 void setId(java.lang.String id)
          Sets the unique id for the LoginProvider
 void setProperties(java.util.Properties properties)
          Sets any properties like LDAP URLs, JDBC configuration, etc needed to configure this particular implementation of the LoginProvider
 void update(Identity identity)
          Updates the user profile data
 void updateRole(Role role)
          Updates the specified role
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPIdentityProvider

public LDAPIdentityProvider()
Method Detail

getId

public java.lang.String getId()
Returns an id that uniquely identifies the LoginProvider plugged into the JBoss SSO system. It should be of the form: si::

Specified by:
getId in interface LoginProvider
Returns:
id of the LoginProvider
Throws:
IdentityException

setId

public void setId(java.lang.String id)
Description copied from interface: LoginProvider
Sets the unique id for the LoginProvider

Specified by:
setId in interface LoginProvider
Parameters:
id -

setProperties

public void setProperties(java.util.Properties properties)
                   throws IdentityException
Sets any properties like LDAP URLs, JDBC configuration, etc needed to configure this particular implementation of the LoginProvider

Specified by:
setProperties in interface LoginProvider
Parameters:
properties -
Throws:
IdentityException

activate

public void activate(Identity identity)
              throws IdentityException
Activates a user account

Specified by:
activate in interface ProvisioningProvider
Parameters:
identity - data of the user account that should be activated
Throws:
IdentityException

activate

public void activate(java.lang.String username)
              throws IdentityException
Activates a user account

Specified by:
activate in interface ProvisioningProvider
Parameters:
username - of the user account that should be activated
Throws:
IdentityException

deactivate

public void deactivate(Identity identity)
                throws IdentityException
Deactivates a user account

Specified by:
deactivate in interface ProvisioningProvider
Parameters:
identity - data of the user account that should be deactivated
Throws:
IdentityException

deactivate

public void deactivate(java.lang.String username)
                throws IdentityException
Deactivates a user account

Specified by:
deactivate in interface ProvisioningProvider
Parameters:
username - of the user account that should be deactivated
Throws:
IdentityException

exists

public boolean exists(java.security.Principal principal)
               throws IdentityException
Checks if the specified Principal exists in the system anymore or not

Specified by:
exists in interface LoginProvider
Parameters:
principal -
Returns:
Throws:
IdentityException

exists

public boolean exists(java.lang.String username)
               throws IdentityException
Checks if the specified username exists in the system anymore or not

Specified by:
exists in interface LoginProvider
Parameters:
username -
Returns:
Throws:
IdentityException

login

public boolean login(java.security.Principal principal,
                     byte[] password)
              throws IdentityException
Checks if the specified Principal should successfully authenticated using the specified password

Specified by:
login in interface LoginProvider
Parameters:
principal -
password -
Returns:
Throws:
IdentityException

login

public boolean login(java.lang.String username,
                     byte[] password)
              throws IdentityException
Checks if the specified username should be successfully authenticated using the specified password

Specified by:
login in interface LoginProvider
Parameters:
username -
password -
Returns:
Throws:
IdentityException

read

public Identity read(java.security.Principal principal)
              throws IdentityException
Returns the Identity data for the specified Principal

Specified by:
read in interface LoginProvider
Parameters:
principal -
Returns:
Identity data for the Principal
Throws:
IdentityException

read

public Identity read(java.lang.String username)
              throws IdentityException
Returns the Identity data for the specified username

Specified by:
read in interface LoginProvider
Parameters:
username -
Returns:
Identity data for the username
Throws:
IdentityException

register

public void register(Identity identity)
              throws IdentityException
Registers a new user into the system

Specified by:
register in interface ProvisioningProvider
Parameters:
identity -
Throws:
IdentityException

remove

public void remove(Identity identity)
            throws IdentityException
Removes a user from the system

Specified by:
remove in interface ProvisioningProvider
Parameters:
identity -
Throws:
IdentityException

remove

public void remove(java.lang.String username)
            throws IdentityException
Removes a user from the system

Specified by:
remove in interface ProvisioningProvider
Parameters:
username -
Throws:
IdentityException

update

public void update(Identity identity)
            throws IdentityException
Updates the user profile data

Specified by:
update in interface ProvisioningProvider
Parameters:
identity -
Throws:
IdentityException

resetPassword

public void resetPassword(java.lang.String username,
                          byte[] password)
                   throws IdentityException
Resets the password of the specified user

Specified by:
resetPassword in interface ProvisioningProvider
Parameters:
username -
password -
Throws:
IdentityException

exists

public boolean exists(Role role)
               throws IdentityException
Checks if the specified role exists in the system

Specified by:
exists in interface ProvisioningProvider
Parameters:
role -
Returns:
Throws:
IdentityException

readRole

public Role readRole(java.lang.String roleName)
              throws IdentityException
Reads role information for the specified role name

Specified by:
readRole in interface ProvisioningProvider
Parameters:
roleName -
Returns:
Throws:
IdentityException

readAllRoles

public java.util.Collection readAllRoles()
                                  throws IdentityException
Return all the authorization roles registered in the system. Note: this is a list of all the roles, and not specific to any particular user

Specified by:
readAllRoles in interface LoginProvider
Returns:
a Collection of all the authorization roles registered in the system
Throws:
IdentityException

addRole

public void addRole(Role role)
             throws IdentityException
Adds a new role to the system

Specified by:
addRole in interface ProvisioningProvider
Parameters:
role -
Throws:
IdentityException

removeRole

public void removeRole(Role role)
                throws IdentityException
Removes a role from the system

Specified by:
removeRole in interface ProvisioningProvider
Parameters:
role -
Throws:
IdentityException

updateRole

public void updateRole(Role role)
                throws IdentityException
Updates the specified role

Specified by:
updateRole in interface ProvisioningProvider
Parameters:
role -
Throws:
IdentityException

processSSOLoginNotification

public void processSSOLoginNotification(LoginContext loginContext)
                                 throws IdentityException
This notification is received from the SSO Engine when the engine performs an automatic logic based on a trusted assertion received from a partner site. The method can be used by the application to setup its environment in response to the user logged in to the system

Specified by:
processSSOLoginNotification in interface LoginProvider
Parameters:
loginContext -
Throws:
IdentityException