org.apache.jetspeed.security.impl
Class DefaultLoginModule

java.lang.Object
  extended byorg.apache.jetspeed.security.impl.DefaultLoginModule
All Implemented Interfaces:
LoginModule
Direct Known Subclasses:
JBossLoginModule

public class DefaultLoginModule
extends Object
implements LoginModule

LoginModule implementation that authenticates a user against a relational database. OJB based implementation.

When a user is successfully authenticated, the user principal are added to the current subject.

The LoginModule also recognizes the debug option.

Configuration files should provide:


 Jetspeed {
   org.apache.jetspeed.security.impl.DefaultLoginModule required debug=true;
 };
 

Author:
David Le Strat

Field Summary
private  CallbackHandler callbackHandler
          A CallbackHandler for communicating with the end user (prompting for usernames and passwords, for example).
private  boolean commitSuccess
          The commit status.
private  boolean debug
          LoginModule debug mode is turned off by default.
private  Map options
          Options specified in the login Configuration for this particular LoginModule.
private  Map sharedState
          State shared with other configured LoginModules.
private  Subject subject
          The Subject to be authenticated.
private  boolean success
          The authentication status.
private  org.apache.jetspeed.security.UserManager ums
          InternalUserPrincipal manager service.
private  String username
          The user name.
 
Constructor Summary
  DefaultLoginModule()
          The default login module constructor.
protected DefaultLoginModule(org.apache.jetspeed.security.UserManager userManager)
          Create a new login module that uses the given user manager.
 
Method Summary
 boolean abort()
           
 boolean commit()
           
protected  void commitPrincipals(Subject subject, org.apache.jetspeed.security.User user)
          Default setup of the logged on Subject Principals for Tomcat
protected  Principal getUserPrincipal(org.apache.jetspeed.security.User user)
           
protected  List getUserRoles(org.apache.jetspeed.security.User user)
           
 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

debug

private boolean debug

LoginModule debug mode is turned off by default.


success

private boolean success

The authentication status.


commitSuccess

private boolean commitSuccess

The commit status.


subject

private Subject subject

The Subject to be authenticated.


callbackHandler

private CallbackHandler callbackHandler

A CallbackHandler for communicating with the end user (prompting for usernames and passwords, for example).


sharedState

private Map sharedState

State shared with other configured LoginModules.


options

private Map options

Options specified in the login Configuration for this particular LoginModule.


ums

private org.apache.jetspeed.security.UserManager ums

InternalUserPrincipal manager service.


username

private String username

The user name.

Constructor Detail

DefaultLoginModule

public DefaultLoginModule()

The default login module constructor.


DefaultLoginModule

protected DefaultLoginModule(org.apache.jetspeed.security.UserManager userManager)
Create a new login module that uses the given user manager.

Parameters:
userManager - the user manager to use
Method Detail

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()

initialize

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

getUserPrincipal

protected Principal getUserPrincipal(org.apache.jetspeed.security.User user)

getUserRoles

protected List getUserRoles(org.apache.jetspeed.security.User user)

commitPrincipals

protected void commitPrincipals(Subject subject,
                                org.apache.jetspeed.security.User user)
Default setup of the logged on Subject Principals for Tomcat

Parameters:
subject -
user -


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