Package org.ldaptive.jaas
Class LdapLoginModule
- java.lang.Object
-
- org.ldaptive.jaas.AbstractLoginModule
-
- org.ldaptive.jaas.LdapLoginModule
-
- All Implemented Interfaces:
LoginModule
public class LdapLoginModule extends AbstractLoginModule
Provides a JAAS authentication hook for LDAP authentication.
-
-
Field Summary
Fields Modifier and Type Field Description private AuthenticatorauthAuthenticator to use against the LDAP.private AuthenticatorFactoryauthenticatorFactoryFactory for creating authenticators with JAAS options.private AuthenticationRequestauthRequestAuthentication request to use for authentication.private String[]userRoleAttributeUser attribute to add to role data.-
Fields inherited from class org.ldaptive.jaas.AbstractLoginModule
callbackHandler, clearPass, commitSuccess, credentials, defaultRole, logger, LOGIN_DN, LOGIN_NAME, LOGIN_PASSWORD, loginSuccess, principalGroupName, principals, roleGroupName, roles, setLdapCredential, setLdapDnPrincipal, setLdapPrincipal, sharedState, storePass, subject, tryFirstPass, useFirstPass
-
-
Constructor Summary
Constructors Constructor Description LdapLoginModule()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)protected booleanlogin(NameCallback nameCb, PasswordCallback passCb)Authenticates aSubjectwith the supplied callbacks.static voidmain(String[] args)This provides command line access to this JAAS module.-
Methods inherited from class org.ldaptive.jaas.AbstractLoginModule
abort, clearState, commit, getCredentials, login, logout, storeCredentials
-
-
-
-
Field Detail
-
userRoleAttribute
private String[] userRoleAttribute
User attribute to add to role data.
-
authenticatorFactory
private AuthenticatorFactory authenticatorFactory
Factory for creating authenticators with JAAS options.
-
auth
private Authenticator auth
Authenticator to use against the LDAP.
-
authRequest
private AuthenticationRequest authRequest
Authentication request to use for authentication.
-
-
Method Detail
-
initialize
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
- Specified by:
initializein interfaceLoginModule- Overrides:
initializein classAbstractLoginModule
-
login
protected boolean login(NameCallback nameCb, PasswordCallback passCb) throws LoginException
Description copied from class:AbstractLoginModuleAuthenticates aSubjectwith the supplied callbacks.- Specified by:
loginin classAbstractLoginModule- Parameters:
nameCb- callback handler for subject's namepassCb- callback handler for subject's password- Returns:
- true if authentication succeeded, false to ignore this module
- Throws:
LoginException- if the authentication fails
-
-