java.lang.Object
org.jboss.security.auth.spi.AbstractServerLoginModule
org.acegisecurity.adapters.jboss.JbossAcegiLoginModule
- All Implemented Interfaces:
- javax.security.auth.spi.LoginModule
- public class JbossAcegiLoginModule
- extends org.jboss.security.auth.spi.AbstractServerLoginModule
Adapter to enable JBoss to authenticate via the Acegi Security System for
Spring.
Returns a org.acegisecurity.adapters.PrincipalAcegiUserToken to JBoss' authentication system,
which is subsequently available from
java:comp/env/security/subject.
- Version:
- $Id: JbossAcegiLoginModule.java,v 1.11 2005/11/25 00:26:30 benalex Exp $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
authenticationManager
private org.acegisecurity.AuthenticationManager authenticationManager
identity
private java.security.Principal identity
key
private java.lang.String key
credential
private char[] credential
JbossAcegiLoginModule
public JbossAcegiLoginModule()
initialize
public void initialize(javax.security.auth.Subject subject,
javax.security.auth.callback.CallbackHandler callbackHandler,
java.util.Map sharedState,
java.util.Map options)
- Description copied from class:
org.jboss.security.auth.spi.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.
The options are checked for the password-stacking parameter.
If this is set to "useFirstPass", the login identity will be taken from the
javax.security.auth.login.name value of the sharedState map,
and the proof of identity from the
javax.security.auth.login.password value of the sharedState map.
login
public boolean login()
throws javax.security.auth.login.LoginException
- Description copied from class:
org.jboss.security.auth.spi.AbstractServerLoginModule
- Looks for javax.security.auth.login.name and javax.security.auth.login.password
values in the sharedState map if the useFirstPass option was true and returns
true if they exist. If they do not or are null this method returns false.
Note that subclasses that override the login method must set the loginOk
ivar to true if the login succeeds in order for the commit phase to
populate the Subject. This implementation sets loginOk to true if the
login() method returns true, otherwise, it sets loginOk to false.
getIdentity
protected java.security.Principal getIdentity()
- Description copied from class:
org.jboss.security.auth.spi.AbstractServerLoginModule
- Overriden by subclasses to return the Principal that corresponds to
the user primary identity.
getRoleSets
protected java.security.acl.Group[] getRoleSets()
throws javax.security.auth.login.LoginException
- Description copied from class:
org.jboss.security.auth.spi.AbstractServerLoginModule
- Overriden by subclasses to return the Groups that correspond to the
to the role sets assigned to the user. Subclasses should create at
least a Group named "Roles" that contains the roles assigned to the user.
A second common group is "CallerPrincipal" that provides the application
identity of the user rather than the security domain identity.
getUsernameAndPassword
protected java.lang.String[] getUsernameAndPassword()
throws javax.security.auth.login.LoginException