|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.n52.security.authentication.loginmodule.AbstractLoginModule
org.n52.security.authentication.loginmodule.AbstractPasswordLoginModule
public abstract class AbstractPasswordLoginModule
Class AbstractPasswordLoginModule provides a frame implementation for login modules which use username and password credentials to authenticate a user.
This class complete supports the PAM flags try_first_pass, try_mapped_pass, use_first_pass and use_mapped_pass in invokes according to their rules thelogin(String,char[])
method.
It also supports the
moduleBanner
and
disabled
flag.
Sub classes have to implement the methods:AbstractLoginModule.getDescription()
AbstractLoginModule.initialize()
login(String,char[])
andAbstractLoginModule.prepareCommitState()
.
Field Summary |
---|
Fields inherited from class org.n52.security.authentication.loginmodule.AbstractLoginModule |
---|
m_callbackHandler, m_commitSucceeded, m_loginSucceeded, m_options, m_principals, m_privateCredentials, m_publicCredentials, m_sharedState, m_subject |
Constructor Summary | |
---|---|
AbstractPasswordLoginModule()
|
Method Summary | |
---|---|
protected void |
clearAuthenticationState()
This clears the internaly stored username and password. |
protected char[] |
getPassword()
Method gets the password. |
protected java.lang.String |
getUsername()
Method gets the username. |
protected boolean |
isEqual(char[] allowedPassword,
char[] password,
boolean ignorecase)
Method isEqual tests the both char[] on equality. |
protected abstract boolean |
login(java.lang.String username,
char[] password)
Method login authenticates a user with a given username and password. |
boolean |
performLogin()
Method performs login via username/password after the PAM-Rules. |
Methods inherited from class org.n52.security.authentication.loginmodule.AbstractLoginModule |
---|
abort, addPrincipal, addPrivateCredential, addPublicCredential, clearInternalState, commit, commitState, destroy, getCallbackHandler, getDescription, getOptions, getPrincipals, getPrivateCredentials, getPublicCredentials, getSharedState, getSubject, handleCallbacks, initialize, initialize, isCallbackHandlerSet, isCommitSucceeded, isLoginSucceeded, login, logout, prepareCommitState, setCommitSucceeded, setLoginSucceeded, showModuleBanner |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractPasswordLoginModule()
Method Detail |
---|
protected char[] getPassword()
protected java.lang.String getUsername()
public boolean performLogin() throws javax.security.auth.login.LoginException
performLogin
in class AbstractLoginModule
javax.security.auth.login.LoginException
- if error occurs.Options.OPTION_TRY_FIRST_PASS
,
Options.OPTION_TRY_MAPPED_PASS
,
Options.OPTION_USE_FIRST_PASS
,
Options.OPTION_USE_MAPPED_PASS
protected void clearAuthenticationState() throws javax.security.auth.login.LoginException
clearAuthenticationState
in class AbstractLoginModule
javax.security.auth.login.LoginException
- if error occurs.AbstractLoginModule.clearAuthenticationState()
protected boolean isEqual(char[] allowedPassword, char[] password, boolean ignorecase)
allowedPassword
- the allowedPassword.password
- the password to check.ignorecase
- ignores case during check.
protected abstract boolean login(java.lang.String username, char[] password) throws javax.security.auth.login.LoginException
getUsername()
and getPassword()
methods.
username
- the username.password
- the password.
javax.security.auth.login.LoginException
- if error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |