Package org.jboss.security
Class AltClientLoginModule
- java.lang.Object
-
- org.jboss.security.AltClientLoginModule
-
- All Implemented Interfaces:
LoginModule
public class AltClientLoginModule extends Object implements LoginModule
A simple implementation of LoginModule for use by JBoss clients for the establishment of the caller identity and credentials. This simply sets the SecurityAssociation principal to the value of the NameCallback filled in by the CallbackHandler, and the SecurityAssociation credential to the value of the PasswordCallback filled in by the CallbackHandler. This is a variation of the original ClientLoginModule that does not set the SecurityAssociation information until commit and that uses the Subject principal over a SimplePrincipal if available. It has the following options:- multi-threaded=[true|false] When the multi-threaded option is set to true, the SecurityAssociation.setServer() so that each login thread has its own principal and credential storage.
- password-stacking=tryFirstPass|useFirstPass When password-stacking option is set, this module first looks for a shared username and password using "javax.security.auth.login.name" and "javax.security.auth.login.password" respectively. This allows a module configured prior to this one to establish a valid username and password that should be passed to JBoss.
- Version:
- $Revision$
- Author:
- Scott.Stark@jboss.org
-
-
Constructor Summary
Constructors Constructor Description AltClientLoginModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
abort()
Method to abort the authentication process (phase 2).boolean
commit()
Method to commit the authentication process (phase 2).void
initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
Initialize this LoginModule.boolean
login()
Method to authenticate a Subject (phase 1).boolean
logout()
-
-
-
Method Detail
-
initialize
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
Initialize this LoginModule.- Specified by:
initialize
in interfaceLoginModule
-
login
public boolean login() throws LoginException
Method to authenticate a Subject (phase 1).- Specified by:
login
in interfaceLoginModule
- Throws:
LoginException
-
commit
public boolean commit() throws LoginException
Method to commit the authentication process (phase 2). This is where the SecurityAssociation information is set. The principal is obtained from: The shared state javax.security.auth.login.name property when useFirstPass is true. If the value is a Principal it is used as is, else a SimplePrincipal using the value.toString() as its name is used. If useFirstPass the username obtained from the callback handler is used to build the SimplePrincipal. Both may be overriden if the resulting authenticated Subject principals set it not empty.- Specified by:
commit
in interfaceLoginModule
- Throws:
LoginException
-
abort
public boolean abort() throws LoginException
Method to abort the authentication process (phase 2).- Specified by:
abort
in interfaceLoginModule
- Throws:
LoginException
-
logout
public boolean logout() throws LoginException
- Specified by:
logout
in interfaceLoginModule
- Throws:
LoginException
-
-