org.apache.jetspeed.services.security
Interface PortalAuthentication

All Superinterfaces:
org.apache.turbine.services.Initable, org.apache.turbine.services.Service
All Known Implementing Classes:
LDAPAuthentication, NoAuthentication, TurbineAuthentication

public interface PortalAuthentication
extends org.apache.turbine.services.Service

The PortalAuthentication interface defines contract between the portal and security provider required for authentication a Jetspeed User. This interface enables an application to be independent of the underlying authentication technology.

If the login method returns without throwing an exception, then the overall authentication succeeded.

To logout the caller simply needs to invoke the logout method.

Version:
$Id: PortalAuthentication.java,v 1.3 2004/02/23 03:58:11 jford Exp $
Author:
David Sean Taylor

Field Summary
static java.lang.String SERVICE_NAME
           
 
Method Summary
 JetspeedUser getAnonymousUser()
          Automatically authenticates and retrieves the portal anonymous user.
 JetspeedUser login(java.lang.String username, java.lang.String password)
          Given a public credential(username) and private credential(password), perform authentication.
 void logout()
          Logout the JetspeedUser.
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
See Also:
Constant Field Values
Method Detail

login

public JetspeedUser login(java.lang.String username,
                          java.lang.String password)
                   throws LoginException
Given a public credential(username) and private credential(password), perform authentication. If authentication succeeds, a JetspeedUser is returned representing the authenticated subject.

Parameters:
username - a public credential of the subject to be authenticated.
password - a private credentialof the subject to be authenticated.
Returns:
a JetspeedUser object representing the authenticated subject.
Throws:
LoginException - when general security provider failure.
FailedLoginException - when the authentication failed.
AccountExpiredException - when the subject's account is expired.
CredentialExpiredException - when the subject's credential is expired.

getAnonymousUser

public JetspeedUser getAnonymousUser()
                              throws LoginException
Automatically authenticates and retrieves the portal anonymous user.

Returns:
a JetspeedUser object representing the authenticated subject.
Throws:
LoginException - if the authentication fails.

logout

public void logout()
            throws LoginException
Logout the JetspeedUser. The logout procedure my may include removing/destroying Principal and Credential information if relevant to the security provider.

Throws:
LoginException - if the logout fails.


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