|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.ldap.jaas.AbstractLoginModule
public abstract class AbstractLoginModule
AbstractLoginModule provides functionality common to ldap based
login modules.
| Field Summary | |
|---|---|
protected CallbackHandler |
callbackHandler
Initialized callback handler. |
protected boolean |
clearPass
Whether credentials should be removed from the shared state map. |
protected boolean |
commitSuccess
Whether commit was successful. |
protected Set<LdapCredential> |
credentials
Credentials to add to the subject. |
protected List<LdapRole> |
defaultRole
Default roles. |
protected org.apache.commons.logging.Log |
logger
Log for this class. |
static String |
LOGIN_DN
Constant for entryDn stored in shared state. |
static String |
LOGIN_NAME
Constant for login name stored in shared state. |
static String |
LOGIN_PASSWORD
Constant for login password stored in shared state. |
protected boolean |
loginSuccess
Whether login was successful. |
protected String |
principalGroupName
Name of group to add all principals to. |
protected Set<Principal> |
principals
Principals to add to the subject. |
protected String |
roleGroupName
Name of group to add all roles to. |
protected Set<Principal> |
roles
Roles to add to the subject. |
protected boolean |
setLdapCredential
Whether ldap credential data should be set. |
protected boolean |
setLdapDnPrincipal
Whether ldap dn principal data should be set. |
protected boolean |
setLdapPrincipal
Whether ldap principal data should be set. |
protected Map |
sharedState
Shared state from other login module. |
protected boolean |
storePass
Whether credentials should be stored in the shared state map. |
protected Subject |
subject
Initialized subject. |
protected boolean |
tryFirstPass
Whether credentials from the shared state should be used if they are available. |
protected boolean |
useFirstPass
Whether credentials from the shared state should be used. |
| Constructor Summary | |
|---|---|
AbstractLoginModule()
|
|
| Method Summary | |
|---|---|
boolean |
abort()
|
protected List<LdapRole> |
attributesToRoles(Attributes attributes)
This parses the supplied attributes and returns them as a list of
LdapRoles. |
protected void |
clearState()
Removes any stateful principals, credentials, or roles stored by login. |
boolean |
commit()
|
static Authenticator |
createAuthenticator(Map<String,?> options)
This constructs a new Authenticator with the supplied jaas
options. |
static Ldap |
createLdap(Map<String,?> options)
This constructs a new Ldap with the supplied jaas options. |
protected void |
getCredentials(NameCallback nameCb,
PasswordCallback passCb,
boolean useCallback)
This attempts to retrieve credentials for the supplied name and password callbacks. |
void |
initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options)
|
abstract boolean |
login()
|
boolean |
logout()
|
protected void |
storeCredentials(NameCallback nameCb,
PasswordCallback passCb,
String loginDn)
This will store the supplied name, password, and entry dn in the stored state map. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String LOGIN_NAME
public static final String LOGIN_DN
public static final String LOGIN_PASSWORD
protected final org.apache.commons.logging.Log logger
protected Subject subject
protected CallbackHandler callbackHandler
protected Map sharedState
protected boolean useFirstPass
protected boolean tryFirstPass
protected boolean storePass
protected boolean clearPass
protected boolean setLdapPrincipal
protected boolean setLdapDnPrincipal
protected boolean setLdapCredential
protected List<LdapRole> defaultRole
protected String principalGroupName
protected String roleGroupName
protected boolean loginSuccess
protected boolean commitSuccess
protected Set<Principal> principals
protected Set<LdapCredential> credentials
protected Set<Principal> roles
| Constructor Detail |
|---|
public AbstractLoginModule()
| Method Detail |
|---|
public void initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options)
initialize in interface LoginModule
public abstract boolean login()
throws LoginException
login in interface LoginModuleLoginException
public boolean commit()
throws LoginException
commit in interface LoginModuleLoginException
public boolean abort()
throws LoginException
abort in interface LoginModuleLoginException
public boolean logout()
throws LoginException
logout in interface LoginModuleLoginExceptionpublic static Ldap createLdap(Map<String,?> options)
Ldap with the supplied jaas options.
options - Map
Ldappublic static Authenticator createAuthenticator(Map<String,?> options)
Authenticator with the supplied jaas
options.
options - Map
Authenticatorprotected void clearState()
protected void getCredentials(NameCallback nameCb,
PasswordCallback passCb,
boolean useCallback)
throws LoginException
nameCb - to set name forpassCb - to set password foruseCallback - whether to force a callback handler
LoginException - if the callback handler fails
protected void storeCredentials(NameCallback nameCb,
PasswordCallback passCb,
String loginDn)
nameCb - to storepassCb - to storeloginDn - to store
protected List<LdapRole> attributesToRoles(Attributes attributes)
throws NamingException
LdapRoles.
attributes - Attributes
List
NamingException - if the attributes cannot be parsed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||