org.jboss.resource.security
Class AbstractPasswordCredentialLoginModule

java.lang.Object
  extended byorg.jboss.security.auth.spi.AbstractServerLoginModule (src) 
      extended byorg.jboss.resource.security.AbstractPasswordCredentialLoginModule
All Implemented Interfaces:
javax.security.auth.spi.LoginModule
Direct Known Subclasses:
CallerIdentityLoginModule (src) , ConfiguredIdentityLoginModule (src) , JaasSecurityDomainIdentityLoginModule (src) , SecureIdentityLoginModule (src)

public abstract class AbstractPasswordCredentialLoginModule
extends AbstractServerLoginModule (src)

A base login module that provides access to the ManagedConnectionFactory needed by the PasswordCredential.

See Also:
PasswordCredential (src)

Field Summary
 
Fields inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule (src)
callbackHandler, loginOk, options, principalClassName, sharedState, subject, unauthenticatedIdentity, useFirstPass
 
Constructor Summary
AbstractPasswordCredentialLoginModule()
           
 
Method Summary
protected  ManagedConnectionFactory (src) getMcf()
           
protected  MBeanServer (src) getServer()
           
 void initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler handler, java.util.Map sharedState, java.util.Map options)
          Initialize the login module.
 boolean login()
          Return false if there is no mcf, else return super.login().
 boolean logout()
          Remove the user identity and roles added to the Subject during commit.
protected  void removeCredentials()
          This removes the javax.security.auth.login.name and javax.security.auth.login.password settings from the sharteState map along with any PasswordCredential found in the PrivateCredentials set
 
Methods inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule (src)
abort, commit, createGroup, createIdentity, getIdentity, getRoleSets, getUnauthenticatedIdentity, getUseFirstPass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPasswordCredentialLoginModule

public AbstractPasswordCredentialLoginModule()
Method Detail

initialize

public void initialize(javax.security.auth.Subject subject,
                       javax.security.auth.callback.CallbackHandler handler,
                       java.util.Map sharedState,
                       java.util.Map options)
Description copied from class: AbstractServerLoginModule (src)
Initialize the login module. This stores the subject, callbackHandler and sharedState and options for the login session. Subclasses should override if they need to process their own options. A call to super.initialize(...) must be made in the case of an override.

Specified by:
initialize in interface javax.security.auth.spi.LoginModule
Overrides:
initialize in class AbstractServerLoginModule (src)
Parameters:
subject - the Subject to update after a successful login.
handler - the CallbackHandler that will be used to obtain the the user identity and credentials.
sharedState - a Map shared between all configured login module instances
options - the parameters passed to the login module.

login

public boolean login()
              throws javax.security.auth.login.LoginException
Return false if there is no mcf, else return super.login(). Override to provide custom authentication.

Specified by:
login in interface javax.security.auth.spi.LoginModule
Overrides:
login in class AbstractServerLoginModule (src)
Returns:
false if there is no mcf, else return super.login().
Throws:
javax.security.auth.login.LoginException - if an error occurs

logout

public boolean logout()
               throws javax.security.auth.login.LoginException
Description copied from class: AbstractServerLoginModule (src)
Remove the user identity and roles added to the Subject during commit.

Specified by:
logout in interface javax.security.auth.spi.LoginModule
Overrides:
logout in class AbstractServerLoginModule (src)
Returns:
true always.
Throws:
javax.security.auth.login.LoginException

getMcf

protected ManagedConnectionFactory (src)  getMcf()

getServer

protected MBeanServer (src)  getServer()

removeCredentials

protected void removeCredentials()
This removes the javax.security.auth.login.name and javax.security.auth.login.password settings from the sharteState map along with any PasswordCredential found in the PrivateCredentials set