|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.spotfire.server.jaas.AbstractLoginModule
com.spotfire.server.jaas.NamePasswordLoginModule
public abstract class NamePasswordLoginModule
An abstract base class for
javax.security.auth.spi.LoginModule implementations
designed for username-password authentication.
A typical subclass implements only the NamePasswordLoginModule.init(),
NamePasswordLoginModule.authenticate(com.spotfire.server.jaas.Credential[]) and NamePasswordLoginModule.getPrincipals() methods. Advanced
LoginModule classes also implements the
NamePasswordLoginModule.getPublicCredentials() and NamePasswordLoginModule.getPrivateCredentials()
methods.
| Field Summary |
|---|
| Fields inherited from class com.spotfire.server.jaas.AbstractLoginModule |
|---|
ASSERT_OPTION, STATE_LOG_OPTION |
| Constructor Summary | |
|---|---|
NamePasswordLoginModule()
|
|
| Method Summary | |
|---|---|
protected boolean |
authenticate(Credential[] credentials)
An implementation of the authenticate method in the
AbstractLoginModule class that delegates the actual
authentication work to the abstract authenticate
method that takes one UsernameCredential and one
PasswordCredential argument. |
abstract boolean |
authenticate(UsernameCredential username,
PasswordCredential password)
This abstract authenticate method is responsible for
validating username-password combinations and must be implemented
by all concrete subclasses. |
protected void |
configureSubClassStateLogger(boolean enabled)
|
protected Callback[] |
createCallbacks()
Creates the Callback items common for all
NamePasswordLoginModule implementation. |
protected Credential[] |
extractCredentials(Callback[] callbacks)
Extracts the username and password from the given Callback array and then creates the
UsernameCredential and
PasswordCredential objects. |
String |
getOption(String name)
Returns the value of the named option from the JAAS application configuration. |
String |
getOption(String name,
String defaultValue)
Returns the value of the named option from the JAAS application configuration. |
PasswordCredential |
getPasswordCredential()
Returns the PasswordCredential extracted from the
input from the PasswordCallback. |
abstract Collection |
getPrincipals()
The getPrincipals method must be implemented by all
concrete subclasses and should return a list of all
Principal objects that should be associated with the
logged in Subject. |
Collection |
getPrivateCredentials()
The getPrivateCredentials method must be implemented
by all concrete subclasses and should return a list of all
private Credential objects that should be associated
with the logged in Subject. |
Collection |
getPublicCredentials()
The getPublicCredentials method must be implemented
by all concrete subclasses and should return a list of all public
Credential objects that should be associated with
the logged in Subject. |
UsernameCredential |
getUsernameCredential()
Returns the UsernameCredential extracted from the
input from the NameCallback. |
abstract void |
init()
An abstract initialization method. |
| Methods inherited from class com.spotfire.server.jaas.AbstractLoginModule |
|---|
abort, commit, configureStateLogger, getCredentials, getOption, getOptions, getSharedState, getState, getSubject, initialize, isAuthenticated, isCommitted, login, logout, setSubject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NamePasswordLoginModule()
| Method Detail |
|---|
protected void configureSubClassStateLogger(boolean enabled)
configureSubClassStateLogger in class AbstractLoginModulepublic abstract void init()
NamePasswordLoginModule.getOption(String)
and NamePasswordLoginModule.getOption(String, String) methods can be used to
retrieve the login module's configuration parameters.
init in class AbstractLoginModuleprotected Callback[] createCallbacks()
Callback items common for all
NamePasswordLoginModule implementation.
createCallbacks in class AbstractLoginModuleCallback array containing, in order, one
NameCallback and one PasswordCallbackprotected Credential[] extractCredentials(Callback[] callbacks)
Callback array and then creates the
UsernameCredential and
PasswordCredential objects. The credential are
returned in an array in mentioned order.
extractCredentials in class AbstractLoginModulecallbacks - an array containing the client-processed
Callback items
Credential objectspublic UsernameCredential getUsernameCredential()
UsernameCredential extracted from the
input from the NameCallback. The method can be used
by a subclass when it is populating the Collection
instances returned by the getPrincipals,
getPublicCredentials and
getPrivateCredentials methods.
UsernameCredentialpublic PasswordCredential getPasswordCredential()
PasswordCredential extracted from the
input from the PasswordCallback. The method can be
used by a subclass when it is populating the
Collection instances returned by the
getPrincipals, getPublicCredentials and
getPrivateCredentials methods.
UsernameCredentialprotected boolean authenticate(Credential[] credentials)
authenticate method in the
AbstractLoginModule class that delegates the actual
authentication work to the abstract authenticate
method that takes one UsernameCredential and one
PasswordCredential argument.
authenticate in class AbstractLoginModulecredentials - a Credential[] value
boolean value
FailedLoginException - if the authentication failsAbstractLoginModule.login()
public abstract boolean authenticate(UsernameCredential username,
PasswordCredential password)
authenticate method is responsible for
validating username-password combinations and must be implemented
by all concrete subclasses. The method should return
true if the authentication succeeds for the given
credentials. If the LoginModule should be ignored
(e.g., when inappropriately requested to authenticate the
root user), the method should return
false. If the authentication fails, a
FailedLoginException should be thrown.
username - the UsernameCredentialpassword - the PasswordCredential
true if
authentication succeeds, or false if the module
should be ignored.
FailedLoginException - if the authentication failspublic abstract Collection getPrincipals()
getPrincipals method must be implemented by all
concrete subclasses and should return a list of all
Principal objects that should be associated with the
logged in Subject. If the method is called multiple
times, it should always return the same Principal
instances. The Collection instance holding the
Principal objects need not be the same, however.
getPrincipals in class AbstractLoginModuleCollection containing all
Principal objects associated with the logged in
Subjectpublic Collection getPublicCredentials()
getPublicCredentials method must be implemented
by all concrete subclasses and should return a list of all public
Credential objects that should be associated with
the logged in Subject. If the method is called
multiple times, it should always return the same
Credential instances. The Collection
instance holding the Credential objects need not be
the same, however.
getPublicCredentials in class AbstractLoginModuleCollection containing all public
Credential objects associated with the logged in
Subjectpublic Collection getPrivateCredentials()
getPrivateCredentials method must be implemented
by all concrete subclasses and should return a list of all
private Credential objects that should be associated
with the logged in Subject. If the method is called
multiple times, it should always return the same
Credential instances. The Collection
instance holding the Credential objects need not be
the same, however.
getPrivateCredentials in class AbstractLoginModuleCollection containing all private
Credential objects associated with the logged in
Subjectpublic String getOption(String name)
getOption in class AbstractLoginModulename - the option name
public String getOption(String name,
String defaultValue)
getOption in class AbstractLoginModulename - the option namedefaultValue - a default option value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||