IBM WebSphere Extended Deployment (XD)TM
Release 6.0

com.ibm.websphere.objectgrid.security.plugins.builtins
LDAPLoginModule

java.lang.Object
  |
  +--com.ibm.websphere.objectgrid.security.plugins.builtins.LDAPLoginModule
All Implemented Interfaces
LoginModule


This LDAPLoginModule authenticates a user with a password to the configured LDAP server.

A login configuration should provide at least the following two options:

Here is a Login module configuration example used by the sample LDAPAuthenticator:


 LDAPLogin {
     com.ibm.websphere.objectgrid.security.plugins.builtins.LDAPLoginModule required 
     providerURL="ldap://bluepages.ibm.com:389/" 
     factoryClass="com.sun.jndi.ldap.LdapCtxFactory"
     debug=true;
 }; 
 
The providerURL points to the IBM bluepages LDAP server with the port number 389. The initial context factory is com.sun.jndi.ldap.LdapCtxFactory.


See Also:
    LoginModule


Field Summary
public  StringPROVIDER_URL
          
public  StringFACTORY_CLASS
          

Constructor Summary
LDAPLoginModule()
          


Method Summary
public  voidinitialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)
           Initialize this LoginModule..
public  booleanlogin()
           Authenticate the user by a user name and password..
public  booleancommit()
          

This method is called if the LoginContext's overall authentication succeeded (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules succeeded).

public  booleanabort()
          

This method is called if the LoginContext's overall authentication failed.

public  booleanlogout()
           Logout the user..

Inherited Methods

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

Field Detail

PROVIDER_URL

public 
  static PROVIDER_URL

FACTORY_CLASS

public 
  static FACTORY_CLASS

Constructor Detail

LDAPLoginModule

public LDAPLoginModule( )


Method Detail

initialize

public void initialize(Subject _subject,CallbackHandler _callbackHandler, Map _sharedState, Map _options)
Initialize this LoginModule.

Parameters:
    _subject - the Subject to be authenticated.

    _callbackHandler - a CallbackHandler for communicating with the end user (prompting for user names and passwords, for example).

    _sharedState - shared LoginModule state.

    _options - options specified in the login Configuration for this particular LoginModule.


login

public boolean login()
Authenticate the user by a user name and password.



Returns:
     true in all cases since this LoginModule should not be ignored.


Throws:
    javax.security.auth.login.FailedLoginExceptionjavax.security.auth.login.LoginException


commit

public boolean commit()

This method is called if the LoginContext's overall authentication succeeded (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules succeeded).

If this LoginModule's own authentication attempt succeeded (checked by retrieving the private state saved by the login method), then this method associates a SamplePrincipal with the Subject located in the LoginModule. If this LoginModule's own authentication attempted failed, then this method removes any state that was originally saved.



Returns:
     true if this LoginModule's own login and commit attempts succeeded, or false otherwise.


Throws:
    javax.security.auth.login.LoginException


abort

public boolean abort()

This method is called if the LoginContext's overall authentication failed. (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules did not succeed).

If this LoginModule's own authentication attempt succeeded (checked by retrieving the private state saved by the login and commit methods), then this method cleans up any state that was originally saved.



Returns:
     false if this LoginModule's own login and/or commit attempts failed, and true otherwise.


Throws:
    javax.security.auth.login.LoginException


logout

public boolean logout()
Logout the user.

This method removes the SamplePrincipal that was added by the commit method.



Returns:
     true in all cases since this LoginModule should not be ignored.


Throws:
    javax.security.auth.login.LoginException


IBM WebSphere Extended Deployment (XD)TM
Release 6.0