org.jboss.security.auth.spi
Class RunAsLoginModule

java.lang.Object
  extended byorg.jboss.security.auth.spi.RunAsLoginModule
All Implemented Interfaces:
javax.security.auth.spi.LoginModule

public class RunAsLoginModule
extends java.lang.Object
implements javax.security.auth.spi.LoginModule

A login module that establishes a run-as role for the duration of the login phase of authentication. It can be used to allow another login module interact with a secured EJB that provides authentication services.


Constructor Summary
RunAsLoginModule()
           
 
Method Summary
 boolean abort()
          Pop the run as role using the SecurityAssociation.popRunAsIdentity method
 boolean commit()
          Calls abort to pop the run-as role
 void initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler handler, java.util.Map sharedState, java.util.Map options)
          Look for the roleName option that specifies the role to use as the run-as role.
 boolean login()
          Push the run as role using the SecurityAssociation.pushRunAsIdentity method
 boolean logout()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunAsLoginModule

public RunAsLoginModule()
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)
Look for the roleName option that specifies the role to use as the run-as role. If not specified a default role name of nobody is used.

Specified by:
initialize in interface javax.security.auth.spi.LoginModule

login

public boolean login()
Push the run as role using the SecurityAssociation.pushRunAsIdentity method

Specified by:
login in interface javax.security.auth.spi.LoginModule
See Also:
SecurityAssociation.pushRunAsIdentity(RunAsIdentity)

commit

public boolean commit()
Calls abort to pop the run-as role

Specified by:
commit in interface javax.security.auth.spi.LoginModule

abort

public boolean abort()
Pop the run as role using the SecurityAssociation.popRunAsIdentity method

Specified by:
abort in interface javax.security.auth.spi.LoginModule
See Also:
SecurityAssociation.popRunAsIdentity()

logout

public boolean logout()
Specified by:
logout in interface javax.security.auth.spi.LoginModule