public abstract class SimpleLogin extends BasicLogin
Based on Tagish JAAS Login Modules package .
Modifier and Type | Field and Description |
---|---|
protected boolean |
commitSucceeded |
protected java.util.Vector |
pending |
protected java.util.Vector |
principals |
callbackHandler, options, sharedState, subject
Constructor and Description |
---|
SimpleLogin() |
Modifier and Type | Method and Description |
---|---|
boolean |
abort()
This method is called if the LoginContext's overall authentication failed.
|
boolean |
commit()
This method is called if the LoginContext's overall authentication
succeeded (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL
LoginModules succeeded).
|
java.lang.String |
getLoginModuleName()
Debuggin utility so login modules can print their name
|
boolean |
login()
Authenticate the user.
|
boolean |
logout()
Logout the user.
|
protected void |
putPrincipal(java.util.Set s,
java.security.Principal p)
Place the specified
Principle in the subject and also record
it in our principles Vector so we can remove them all later. |
protected void |
showSharedState()
Debugging utility to show the contents of the sharedState map
|
protected abstract java.util.Vector |
validateUser(java.lang.String username,
char[] password)
Validate a user's credentials and either throw a LoginException (if
validation fails) or return a Vector of Principals if validation succeeds.
|
getOption, getOption, getOption, initialize
protected java.util.Vector principals
protected java.util.Vector pending
protected boolean commitSucceeded
protected abstract java.util.Vector validateUser(java.lang.String username, char[] password) throws javax.security.auth.login.LoginException
username
- The usernamepassword
- The passwordjavax.security.auth.login.LoginException
- if the login fails.public boolean login() throws javax.security.auth.login.LoginException
LoginModule
should not be ignored.javax.security.auth.login.LoginException
- if this LoginModule
is unable to
perform the authentication.protected void putPrincipal(java.util.Set s, java.security.Principal p)
Principle
in the subject and also record
it in our principles Vector
so we can remove them all later.s
- The Set
to add the Principle top
- Principle to addpublic boolean commit() throws javax.security.auth.login.LoginException
If this LoginModule's own authentication attempt succeeded (checked by
retrieving the private state saved by the login
method), then
this method associates a number of NTPrincipal
s 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.
javax.security.auth.login.LoginException
- if the commit fails.public boolean abort() throws javax.security.auth.login.LoginException
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.
javax.security.auth.login.LoginException
- if the abort fails.public boolean logout() throws javax.security.auth.login.LoginException
This method removes the Principal
s that were added by the
commit
method.
LoginModule
should not be ignored.javax.security.auth.login.LoginException
- if the logout fails.protected void showSharedState()
public java.lang.String getLoginModuleName()