org.apache.cocoon.auth
Interface ApplicationManager

All Known Implementing Classes:
StandardApplicationManager

public interface ApplicationManager

This is the central component of Cocoon Authentication. It controls all applications defined in the current Cocoon instance and provides ways to authenticate a user.

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

Field Summary
static String APPLICATION
          The string used to store the application in the object model.
static String APPLICATION_DATA
          The string used to store the application data in the object model .
static String LOGIN_CONTEXT_PARAMETERS_KEY
          The key for parameters in the login context.
static String LOGOUT_CONTEXT_MODE_KEY
          The key for the logout method in the logout context.
static String LOGOUT_CONTEXT_PARAMETERS_KEY
          The key for parameters in the logout context.
static String LOGOUT_MODE_KEEP_SESSION
          logout mode: don't terminate the session.
static String LOGOUT_MODE_TERMINATE_SESSION_IF_UNUSED
          logout mode: terminate session if the user is not logged into any application anymore (default).
static String USER
          The string used to store the user in the object model and the prefix for the session.
 
Method Summary
 boolean isLoggedIn(String appName)
          Test, if the current user is already logged into the application.
 User login(String appName, Map loginContext)
          Log the user in to the application.
 void logout(String appName, Map logoutContext)
          Logout the user from an application.
 

Field Detail

USER

static final String USER
The string used to store the user in the object model and the prefix for the session.

See Also:
Constant Field Values

APPLICATION

static final String APPLICATION
The string used to store the application in the object model.

See Also:
Constant Field Values

APPLICATION_DATA

static final String APPLICATION_DATA
The string used to store the application data in the object model .

See Also:
Constant Field Values

LOGIN_CONTEXT_PARAMETERS_KEY

static final String LOGIN_CONTEXT_PARAMETERS_KEY
The key for parameters in the login context.

See Also:
Constant Field Values

LOGOUT_CONTEXT_PARAMETERS_KEY

static final String LOGOUT_CONTEXT_PARAMETERS_KEY
The key for parameters in the logout context.

See Also:
Constant Field Values

LOGOUT_CONTEXT_MODE_KEY

static final String LOGOUT_CONTEXT_MODE_KEY
The key for the logout method in the logout context.

See Also:
Constant Field Values

LOGOUT_MODE_TERMINATE_SESSION_IF_UNUSED

static final String LOGOUT_MODE_TERMINATE_SESSION_IF_UNUSED
logout mode: terminate session if the user is not logged into any application anymore (default).

See Also:
Constant Field Values

LOGOUT_MODE_KEEP_SESSION

static final String LOGOUT_MODE_KEEP_SESSION
logout mode: don't terminate the session.

See Also:
Constant Field Values
Method Detail

isLoggedIn

boolean isLoggedIn(String appName)
Test, if the current user is already logged into the application.

Parameters:
appName - The name of the application.
Returns:
Returns true if the user is already logged in, false otherwise.

login

User login(String appName,
           Map loginContext)
           throws Exception
Log the user in to the application. If the user is already logged in then the corresponding user object is returned. If the login process is started, the login context is passed to SecurityHandler.login(Map) and on successful login to Application.userDidLogin(User, Map).

Parameters:
appName - The name of the application.
loginContext - The context for the login operation.
Returns:
The user object on a successful login, null otherwise.
Throws:
Exception - If anything goes wrong.

logout

void logout(String appName,
            Map logoutContext)
Logout the user from an application. During the logout process, the logout context is passed to Application.userWillLogout(User, Map), and eventually to SecurityHandler.logout(Map, User).

Parameters:
appName - The name of the application.
logoutContext - The context for the logout operation.


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