org.hippoecm.hst.security.impl
Class DefaultLoginModule

java.lang.Object
  extended by org.hippoecm.hst.security.impl.DefaultLoginModule
All Implemented Interfaces:
LoginModule

public class DefaultLoginModule
extends Object
implements LoginModule

DefaultLoginModule

Version:
$Id$

Field Summary
protected  AuthenticationProvider authProvider
          The authentication provider service.
protected  CallbackHandler callbackHandler
          A CallbackHandler for communicating with the end user (prompting for usernames and passwords, for example).
protected  boolean commitSuccess
          The commit status.
protected  boolean debug
          LoginModule debug mode is turned off by default.
protected  Map<String,?> options
          Options specified in the login Configuration for this particular LoginModule.
protected  Map<String,?> sharedState
          State shared with other configured LoginModules.
protected  boolean storePrivCreds
          LoginModule private credentials storing mode is turned off by default.
protected  boolean storePubCreds
          LoginModule public credentials storing mode is turned off by default.
protected  Subject subject
          The Subject to be authenticated.
protected  boolean success
          The authentication status.
protected  User user
           
protected  String username
          The user name.
 
Constructor Summary
  DefaultLoginModule()
          The default login module constructor.
protected DefaultLoginModule(AuthenticationProvider authProvider)
          Create a new login module that uses the given authentication provider
 
Method Summary
 boolean abort()
           
 boolean commit()
           
protected  void commitSubject(Subject containerSubject, User user)
          Default setup of the logged on Subject Principals for Tomcat
protected  javax.jcr.Credentials createSubjectRepositoryCredentials(String username, char[] password)
          Creates repository credentials for the authenticated user.
protected  AuthenticationProvider getAuthenticationProvider()
           
 void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> 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

protected boolean debug

LoginModule debug mode is turned off by default.


storePubCreds

protected boolean storePubCreds

LoginModule public credentials storing mode is turned off by default.


storePrivCreds

protected boolean storePrivCreds

LoginModule private credentials storing mode is turned off by default.


success

protected boolean success

The authentication status.


commitSuccess

protected boolean commitSuccess

The commit status.


subject

protected Subject subject

The Subject to be authenticated.


callbackHandler

protected CallbackHandler callbackHandler

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


sharedState

protected Map<String,?> sharedState

State shared with other configured LoginModules.


options

protected Map<String,?> options

Options specified in the login Configuration for this particular LoginModule.


authProvider

protected AuthenticationProvider authProvider

The authentication provider service.


username

protected String username

The user name.


user

protected User user
Constructor Detail

DefaultLoginModule

public DefaultLoginModule()

The default login module constructor.


DefaultLoginModule

protected DefaultLoginModule(AuthenticationProvider authProvider)
Create a new login module that uses the given authentication provider

Parameters:
authProvider - the authentication provider 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<String,?> sharedState,
                       Map<String,?> 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)

commitSubject

protected void commitSubject(Subject containerSubject,
                             User user)
Default setup of the logged on Subject Principals for Tomcat

Parameters:
subject -
user -

getAuthenticationProvider

protected AuthenticationProvider getAuthenticationProvider()
                                                    throws SecurityException
Throws:
SecurityException

createSubjectRepositoryCredentials

protected javax.jcr.Credentials createSubjectRepositoryCredentials(String username,
                                                                   char[] password)
Creates repository credentials for the authenticated user.

This method is invoked when the 'storedPrivCreds' option is true, to store a repository credentials for the authenticated user. By default, this method creates a repository credentials with the same user/password credentials used during authentication.

A child class can override this method to behave differently.

Parameters:
username -
password -
Returns:


Copyright © 2008-2012 Hippo. All Rights Reserved.