Author: alain_defrance
Date: 2010-10-08 10:41:51 -0400 (Fri, 08 Oct 2010)
New Revision: 4611
Modified:
components/wci/branches/adf/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java
components/wci/branches/adf/wci/src/main/java/org/gatein/wci/security/WCILoginController.java
Log:
Some bugs fixed
Modified:
components/wci/branches/adf/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java
===================================================================
---
components/wci/branches/adf/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java 2010-10-08
14:40:14 UTC (rev 4610)
+++
components/wci/branches/adf/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java 2010-10-08
14:41:51 UTC (rev 4611)
@@ -37,9 +37,12 @@
import org.gatein.common.logging.LoggerFactory;
import org.gatein.wci.RequestDispatchCallback;
import org.gatein.wci.authentication.AuthenticationResult;
+import org.gatein.wci.authentication.GenericAuthentication;
+import org.gatein.wci.authentication.GenericAuthenticationResult;
import org.gatein.wci.authentication.ProgrammaticAuthenticationResult;
import org.gatein.wci.command.CommandDispatcher;
import org.gatein.wci.impl.DefaultServletContainerFactory;
+import org.gatein.wci.security.Credentials;
import org.gatein.wci.spi.ServletContainerContext;
import javax.servlet.ServletContext;
@@ -102,13 +105,32 @@
public AuthenticationResult login(HttpServletRequest request, HttpServletResponse
response, String userName, String password) throws ServletException
{
- request.login(userName, password);
+ try
+ {
+ request.login(userName, password);
+ }
+ catch (ServletException se)
+ {
+ try
+ {
+ String ticket = GenericAuthentication.TICKET_SERVICE.createTicket(new
Credentials(userName, password));
+ String url = "j_security_check?j_username=" + userName +
"&j_password=" + ticket;
+ url = response.encodeRedirectURL(url);
+ response.sendRedirect(url);
+ response.flushBuffer();
+ }
+ catch (Exception ignore)
+ {
+ }
+ return null;
+ }
return new ProgrammaticAuthenticationResult();
}
public void logout(HttpServletRequest request, HttpServletResponse response) throws
ServletException
{
request.logout();
+ request.getSession().invalidate();
}
public synchronized void containerEvent(ContainerEvent event)
Modified:
components/wci/branches/adf/wci/src/main/java/org/gatein/wci/security/WCILoginController.java
===================================================================
---
components/wci/branches/adf/wci/src/main/java/org/gatein/wci/security/WCILoginController.java 2010-10-08
14:40:14 UTC (rev 4610)
+++
components/wci/branches/adf/wci/src/main/java/org/gatein/wci/security/WCILoginController.java 2010-10-08
14:41:51 UTC (rev 4611)
@@ -27,7 +27,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
-import java.lang.reflect.Field;
/**
* @author <a href="mailto:alain.defrance@exoplatform.com">Alain
Defrance</a>
@@ -69,6 +68,5 @@
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
{
doGet(req, resp);
- Field f;
}
}
Show replies by date