|
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.p13n.security.Authentication
public final class 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 Subject |
authenticate(String username,
String password)
Authenticate a user and return the authenticated Subject. |
static Subject |
getAnonymousSubject()
Get a Subject representing an Anonymous user |
static Subject |
getCurrentSubject()
Get the current logged in user. |
static Principal |
getUserPrincipal(Subject subject)
Get the Principal representing the given Subject. |
static boolean |
isAdministrator(Subject subject)
Test if the given Subject represents a server Administrator |
static boolean |
isAnonymous(Principal principal)
Test if the given Principal represents the Anonymous user |
static boolean |
isAnonymous(Subject subject)
Test if the given Subject represents an Anonymous user |
static void |
login(String username,
String password,
javax.servlet.http.HttpServletRequest request)
Deprecated in favor of login(String, String, HttpServletRequest, HttpServletResponse) |
static void |
login(String username,
String password,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
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 Object |
runAs(Subject subject,
PrivilegedAction action)
Execute a PrivilegedAction as a particular user. |
static Object |
runAs(Subject subject,
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 |
---|
@Deprecated public static void login(String username, String password, javax.servlet.http.HttpServletRequest request) throws LoginException
login(String, String, HttpServletRequest, HttpServletResponse)
username
- The username of the user to loginpassword
- The password for that user (as cleartext)request
- The HttpServletRequest containing the session to be logged in
LoginException
- if the authentication failedpublic static void login(String username, String password, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws 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 inresponse
- The HttpServletResponse containing data sent back to client
LoginException
- if the authentication failedpublic static void logout(javax.servlet.http.HttpServletRequest request, boolean invalidateSessions)
request
- the HttpServletRequest that contains the session to be logged out.invalidateSessions
- 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 Subject authenticate(String username, String password) throws LoginException
username
- The username of the user to authenticatepassword
- The password for that user (as cleartext)
LoginException
- if the user is not validpublic static Object runAs(Subject subject, PrivilegedAction action)
public static Object runAs(Subject subject, PrivilegedExceptionAction action) throws PrivilegedActionException
PrivilegedActionException
public static Subject getCurrentSubject()
public static Subject getAnonymousSubject()
public static Principal getUserPrincipal(Subject subject)
public static boolean isAnonymous(Subject subject)
public static boolean isAnonymous(Principal principal)
public static boolean isAdministrator(Subject subject)
|
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |