org.apache.jetspeed.appservers.security.jboss
Class LoginModule

java.lang.Object
  extended byorg.apache.jetspeed.appservers.security.jboss.LoginModule
All Implemented Interfaces:
LoginModule

public class LoginModule
extends Object
implements LoginModule

A login module that uses the JetspeedSecurityService MBean for authentication and role assignment.


Nested Class Summary
private  class LoginModule.LoginModuleDelegee
          Helper for delaying the creation of the JBossLoginModule.
 
Field Summary
private  org.apache.jetspeed.security.impl.ext.JBossLoginModule delegee
           
private  String securityService
           
 
Constructor Summary
LoginModule()
          Create a new login module.
 
Method Summary
 boolean abort()
           
 boolean commit()
           
private  org.apache.jetspeed.security.UserManager getUserManager()
           
 void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
           
 boolean login()
           
 boolean logout()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

securityService

private String securityService

delegee

private org.apache.jetspeed.security.impl.ext.JBossLoginModule delegee
Constructor Detail

LoginModule

public LoginModule()
Create a new login module. The module looks up the JetspeedSecurityService MBean and uses it to actually perform authentication and role lookup.

Note that the MBean must be available when this login module is instantiated. Therefore, if the MBean (the SAR) is deployed after JBoss has been started, this login module must be created lazily by using the JBoss login module proxy in login-config.xml.

  <application-policy name = "sample">
    <authentication>
      <login-module code = "org.jboss.security.auth.spi.ProxyLoginModule"
        flag = "required">
        <module-option name = "moduleName">
          org.apache.jetspeed.appservers.security.jboss.LoginModule
        </module-option>
        <!-- The name of the security service MBean. Must match
             the name in jboss-service.xml -->
        <module-option name = "securityService">
          org.apache.jetspeed:service=JetspeedSecurityService         
        </module-option>
      </login-module>
    </authentication>
  </application-policy>
 

Method Detail

getUserManager

private org.apache.jetspeed.security.UserManager getUserManager()

initialize

public void initialize(Subject subject,
                       CallbackHandler callbackHandler,
                       Map sharedState,
                       Map options)
Specified by:
initialize in interface LoginModule
See Also:
javax.security.auth.spi.LoginModule#initialize()

abort

public boolean abort()
              throws LoginException
Specified by:
abort in interface LoginModule
Throws:
LoginException
See Also:
LoginModule.abort()

commit

public boolean commit()
               throws LoginException
Specified by:
commit in interface LoginModule
Throws:
LoginException
See Also:
LoginModule.commit()

login

public boolean login()
              throws LoginException
Specified by:
login in interface LoginModule
Throws:
LoginException
See Also:
LoginModule.login()

logout

public boolean logout()
               throws LoginException
Specified by:
logout in interface LoginModule
Throws:
LoginException
See Also:
LoginModule.logout()


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.