Hello
I have a request from a user of my portal to automatically log in the user into the portal and then take them to a particular page say p1.jsp .
The user will pass a param in the request "next_url=UserManager/UserListPortletWindow?action=2&operation=view_reg_code"
Since I use a DatabaseLoginModule I am able to to the authenticate the user by having his link point to
/portal/j_security_check?&j_username=xyz&j_password=y&next_url=above string
This works fine, the user is logged in, but the user is brought to the home page or default page specified in the web.xml.
How do I redirect or forward the request to the next_url after successfully authenticating him.
I tried to put in the following code in the commit() method of the DatabaseLoginModule in a failed attempt to forward the request
public boolean commit() throws LoginException {
boolean result = super.commit();
try{
HttpServletRequest request = (HttpServletRequest) PolicyContext.getContext(REQUEST_CONTEXT);
RequestDispatcher rd = request.getRequestDispatcher("/users");
HttpServletResponse response = (HttpServletResponse) PolicyContext.getContext("javax.servlet.http.HttpServletResponse");
rd.forward(request, response);
} catch (Exception e) {
log.error("Caught Exception while putting MyRackspaceUser in session!", e);
}
return result;
}
Just an update that:
I am using Jboss Portal 2.6 Beta and
JBoss App Server 4.0.5