org.apache.cocoon.auth.impl
Class ServletSecurityHandler

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.auth.AbstractSecurityHandler
          extended by org.apache.cocoon.auth.impl.ServletSecurityHandler
All Implemented Interfaces:
Configurable, Contextualizable, LogEnabled, ThreadSafe, SecurityHandler

public class ServletSecurityHandler
extends AbstractSecurityHandler

Verify if a user can be authenticated. This is a very simple authenticator that checks if the user is authenticated using the servlet authentication mechanisms.

Version:
$Id: ServletSecurityHandler.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Nested Class Summary
static class ServletSecurityHandler.ServletUser
          Inner class for the current user.
 
Field Summary
protected  Context context
          The component context.
 
Fields inherited from class org.apache.cocoon.auth.AbstractSecurityHandler
id
 
Constructor Summary
ServletSecurityHandler()
           
 
Method Summary
 void contextualize(Context aContext)
           
protected  User createUser(Request req)
          Create a new user.
 User login(Map loginContext)
          Try to authenticate the user.
 void logout(Map logoutContext, User user)
          This notifies the security-handler that a user logs out.
 
Methods inherited from class org.apache.cocoon.auth.AbstractSecurityHandler
configure, getId
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected Context context
The component context.

Constructor Detail

ServletSecurityHandler

public ServletSecurityHandler()
Method Detail

contextualize

public void contextualize(Context aContext)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Overrides:
contextualize in class AbstractSecurityHandler
Throws:
ContextException
See Also:
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)

createUser

protected User createUser(Request req)
Create a new user.

Parameters:
req - The current request.
Returns:
A new user object.

login

public User login(Map loginContext)
           throws Exception
Description copied from interface: SecurityHandler
Try to authenticate the user.

Parameters:
loginContext - The context for the login operation.
Returns:
The user if the authentication is successful, null otherwise.
Throws:
Exception - If something goes wrong.
See Also:
SecurityHandler.login(java.util.Map)

logout

public void logout(Map logoutContext,
                   User user)
Description copied from interface: SecurityHandler
This notifies the security-handler that a user logs out.

Parameters:
logoutContext - The context for the login operation.
user - The user object.
See Also:
SecurityHandler.logout(java.util.Map, org.apache.cocoon.auth.User)


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.