Package org.ldaptive.jaas
Class LdapLoginModule
java.lang.Object
org.ldaptive.jaas.AbstractLoginModule
org.ldaptive.jaas.LdapLoginModule
- All Implemented Interfaces:
LoginModule
Provides a JAAS authentication hook for LDAP authentication.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AuthenticatorAuthenticator to use against the LDAP.private AuthenticatorFactoryFactory for creating authenticators with JAAS options.private AuthenticationRequestAuthentication request to use for authentication.private String[]User 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) protected booleanlogin(NameCallback nameCb, PasswordCallback passCb) Authenticates aSubjectwith the supplied callbacks.static voidThis provides command line access to this JAAS module.Methods inherited from class org.ldaptive.jaas.AbstractLoginModule
abort, clearState, commit, getCredentials, login, logout, storeCredentials
-
Field Details
-
userRoleAttribute
User attribute to add to role data. -
authenticatorFactory
Factory for creating authenticators with JAAS options. -
auth
Authenticator to use against the LDAP. -
authRequest
Authentication request to use for authentication.
-
-
Constructor Details
-
LdapLoginModule
public LdapLoginModule()
-
-
Method Details
-
initialize
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) - Specified by:
initializein interfaceLoginModule- Overrides:
initializein classAbstractLoginModule
-
login
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
-
main
This provides command line access to this JAAS module.- Parameters:
args- command line arguments- Throws:
Exception- if an error occurs
-