|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ImpersonationService
This Interface can be used to access the impersonation functionality of
WebSphere Portal.
An instance can be retrieved using a JNDI lookup for the following JNDI name
portal:service/impersonation/ImpersonationService.
The name is also available via a constant of the Interface itself
ImpersonationService.JNDI_NAME
The following sample shows how to perform the JNDI lookup to acquire a
service object:
com.ibm.portal.impersonation.ImpersonationService impersonationService;
javax.naming.Context ctx = new javax.naming.InitialContext();
try {
impersonationService = (ImpersonationService) ctx.lookup(ImpersonationService.JNDI_NAME);
} catch(javax.naming.NameNotFoundException ex) {
// error handling
}
NOTE: This API may only be used in the scope of an HTTP request in WebSphere Portal, i.e. within a theme.
The API can not be invoked directly by a custom servlet.
| Field Summary | |
|---|---|
static java.lang.String |
JNDI_NAME
The name can be used to lookup the ImpersonationService from JNDI |
| Method Summary | |
|---|---|
void |
doImpersonate(javax.servlet.http.HttpServletRequest aRequest,
javax.servlet.http.HttpServletResponse aResponse,
java.lang.String impUserDN)
This method starts the impersonation. |
void |
doImpersonate(javax.servlet.http.HttpServletRequest aRequest,
javax.servlet.http.HttpServletResponse aResponse,
com.ibm.portal.um.User impUser)
This method starts the impersonation. |
com.ibm.portal.um.User |
getOriginalUser()
This method returns the original user that has logged in. |
boolean |
isUserImpersonated()
This method indicates whether the current user has been impersonated or he is acting on its own behalf. |
void |
loginOriginalUser(javax.servlet.http.HttpServletRequest aRequest,
javax.servlet.http.HttpServletResponse aResponse)
This method ends the impersonation. |
| Field Detail |
|---|
static final java.lang.String JNDI_NAME
ImpersonationService from JNDI
| Method Detail |
|---|
void doImpersonate(javax.servlet.http.HttpServletRequest aRequest,
javax.servlet.http.HttpServletResponse aResponse,
java.lang.String impUserDN)
throws ImpersonationException
isUserImpersonated() returns true), an
ImpersonationExcetion will be thrown.
aRequest - The current HttpServletRequest.aResponse - The current HttpServletResponse.impUserDN - The user DN to be impersonated
ImpersonationException - If impersonation fails, e.g. if the current user is already
impersonated or does not have sufficient privileges to perform the
impersonation.
void doImpersonate(javax.servlet.http.HttpServletRequest aRequest,
javax.servlet.http.HttpServletResponse aResponse,
com.ibm.portal.um.User impUser)
throws ImpersonationException
isUserImpersonated() returns true), an
ImpersonationExcetion will be thrown.
aRequest - The current HttpServletRequest.aResponse - The current HttpServletResponse.impUser - The user to be impersonated
ImpersonationException - If impersonation fails, e.g. if the current user is already
impersonated or does not have sufficient privileges to perform the
impersonation.
void loginOriginalUser(javax.servlet.http.HttpServletRequest aRequest,
javax.servlet.http.HttpServletResponse aResponse)
throws ImpersonationException
servletRequest - The current HttpServletRequest.servletResponse - The current HttpServletResponse.
ImpersonationException - If impersonation fails.
boolean isUserImpersonated()
throws ImpersonationException
ImpersonationException - if impersonation status could not be determined.
com.ibm.portal.um.User getOriginalUser()
throws ImpersonationException
loginOriginalUser(HttpServletRequest, HttpServletResponse) is be called.
ImpersonationException - if the original user could not be determined.isUserImpersonated() to evaluate if
impersonation has been executed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||