org.jboss.resource.security
Class AbstractPasswordCredentialLoginModule

java.lang.Object
  extended by org.jboss.security.auth.spi.AbstractServerLoginModule
      extended by org.jboss.resource.security.AbstractPasswordCredentialLoginModule
All Implemented Interfaces:
LoginModule
Direct Known Subclasses:
CallerIdentityLoginModule, ConfiguredIdentityLoginModule, JaasSecurityDomainIdentityLoginModule, PBEIdentityLoginModule, SecureIdentityLoginModule

public abstract class AbstractPasswordCredentialLoginModule
extends AbstractServerLoginModule

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

Version:
$Revision: 71545 $
Author:
David Jencks, Scott.Stark@jboss.org
See Also:
PasswordCredential

Field Summary
 
Fields inherited from class org.jboss.security.auth.spi.AbstractServerLoginModule
callbackHandler, loginOk, options, principalClassName, sharedState, subject, unauthenticatedIdentity, useFirstPass
 
Constructor Summary
AbstractPasswordCredentialLoginModule()
           
 
Method Summary
protected  javax.resource.spi.ManagedConnectionFactory getMcf()
           
protected  MBeanServer getServer()
           
 void initialize(Subject subject, CallbackHandler handler, Map sharedState, 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
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(Subject subject,
                       CallbackHandler handler,
                       Map sharedState,
                       Map options)
Description copied from class: AbstractServerLoginModule
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 LoginModule
Overrides:
initialize in class AbstractServerLoginModule
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 LoginException
Return false if there is no mcf, else return super.login(). Override to provide custom authentication.

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

logout

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

Specified by:
logout in interface LoginModule
Overrides:
logout in class AbstractServerLoginModule
Returns:
true always.
Throws:
LoginException

getMcf

protected javax.resource.spi.ManagedConnectionFactory getMcf()

getServer

protected MBeanServer 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



Copyright © 2009 JBoss Inc.. All Rights Reserved.