|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.p13n.security.Authentication
Central place to handle authentication issues. Use this class to handle login, logout, and authentication of users. Can also do some basic tests on Subjects and Principals. In many cases, the methods in this class are thin wrappers over similar functionality available in other WebLogic classes. This class centralizes these functions and allows some convenience groupings for particular usages.
Field Summary | |
static com.bea.p13n.i18n.AuthenticationExceptionTextFormatter |
formatter
Text formatter for i18n. |
Method Summary | |
static javax.security.auth.Subject |
authenticate(java.lang.String username,
java.lang.String password)
Authenticate a user and return the authenticated Subject. |
static javax.security.auth.Subject |
getAnonymousSubject()
Get a Subject representing an Anonymous user |
static javax.security.auth.Subject |
getCurrentSubject()
Get the current logged in user. |
static java.security.Principal |
getUserPrincipal(javax.security.auth.Subject subject)
Get the Principal representing the given Subject. |
static boolean |
isAdministrator(javax.security.auth.Subject subject)
Test if the given Subject represents a server Administrator |
static boolean |
isAnonymous(java.security.Principal principal)
Test if the given Principal represents the Anonymous user |
static boolean |
isAnonymous(javax.security.auth.Subject subject)
Test if the given Subject represents an Anonymous user |
static void |
login(java.lang.String username,
java.lang.String password,
javax.servlet.http.HttpServletRequest request)
Log in the user to a webapp. |
static void |
logout(javax.servlet.http.HttpServletRequest request)
Same as logout( request, true ) |
static void |
logout(javax.servlet.http.HttpServletRequest request,
boolean invalidateSessions)
Logout the user. |
static java.lang.Object |
runAs(javax.security.auth.Subject subject,
java.security.PrivilegedAction action)
Execute a PrivilegedAction as a particular user. |
static java.lang.Object |
runAs(javax.security.auth.Subject subject,
java.security.PrivilegedExceptionAction action)
Execute a PrivilegedExceptionAction as a particular user. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final com.bea.p13n.i18n.AuthenticationExceptionTextFormatter formatter
Method Detail |
public static void login(java.lang.String username, java.lang.String password, javax.servlet.http.HttpServletRequest request) throws javax.security.auth.login.LoginException
username
- The username of the user to loginpassword
- The password for that user (as cleartext)request
- The HttpServletRequest containing the session to be logged inpublic static void logout(javax.servlet.http.HttpServletRequest request, boolean invalidateSessions)
request
- the HttpServletRequest that contains the session to be logged out.invalidateSession
- if true, the session is invalidated (on all
single-signon webapps). Otherwise the session and its data
are left intact (except for authentication information used
internally by the server).public static void logout(javax.servlet.http.HttpServletRequest request)
logout(HttpServletRequest,boolean)
public static javax.security.auth.Subject authenticate(java.lang.String username, java.lang.String password) throws javax.security.auth.login.LoginException
username
- The username of the user to authenticatepassword
- The password for that user (as cleartext)public static java.lang.Object runAs(javax.security.auth.Subject subject, java.security.PrivilegedAction action)
public static java.lang.Object runAs(javax.security.auth.Subject subject, java.security.PrivilegedExceptionAction action) throws java.security.PrivilegedActionException
public static javax.security.auth.Subject getCurrentSubject()
public static javax.security.auth.Subject getAnonymousSubject()
public static java.security.Principal getUserPrincipal(javax.security.auth.Subject subject)
public static boolean isAnonymous(javax.security.auth.Subject subject)
public static boolean isAnonymous(java.security.Principal principal)
public static boolean isAdministrator(javax.security.auth.Subject subject)
|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |