org.apache.jetspeed.services
Class JetspeedAuthentication

java.lang.Object
  extended byorg.apache.jetspeed.services.JetspeedAuthentication

public abstract class JetspeedAuthentication
extends java.lang.Object

Static accessor for the JetspeedAuthentication service

Version:
$Id: JetspeedAuthentication.java,v 1.4 2004/02/23 04:00:57 jford Exp $
Author:
David Sean Taylor

Constructor Summary
JetspeedAuthentication()
           
 
Method Summary
static JetspeedUser getAnonymousUser()
          Automatically authenticates and retrieves the portal anonymous user.
protected static PortalAuthentication getService()
           
static JetspeedUser login(java.lang.String username, java.lang.String password)
          Given a public credential(username) and private credential(password), perform authentication.
static void logout()
          Logout the JetspeedUser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JetspeedAuthentication

public JetspeedAuthentication()
Method Detail

login

public static 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 static 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 static 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.

getService

protected static PortalAuthentication getService()


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