Author: alain_defrance
Date: 2010-10-06 07:08:45 -0400 (Wed, 06 Oct 2010)
New Revision: 4537
Removed:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/Credentials.java
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/ClusteredSSOFilter.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/GateInToken.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/PortalLoginModule.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/Token.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/TokenStore.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenContainer.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenEntry.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java
portal/branches/wci/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetToken.java
portal/branches/wci/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenInfoService.java
portal/branches/wci/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIForgetPassword.java
Log:
Only use the WCI Credentials
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/ClusteredSSOFilter.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/ClusteredSSOFilter.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/ClusteredSSOFilter.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -25,9 +25,9 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.web.AbstractFilter;
-import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.PortalLoginModule;
+import org.gatein.wci.security.Credentials;
import org.jboss.web.tomcat.security.login.WebAuthentication;
import javax.servlet.FilterChain;
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -21,14 +21,13 @@
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.web.AbstractHttpServlet;
-import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.security.AbstractTokenService;
import org.exoplatform.web.security.security.CookieTokenService;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
import org.gatein.wci.authentication.AuthenticationResult;
import org.gatein.wci.authentication.GenericAuthenticationResult;
-import org.gatein.wci.authentication.WCICredentials;
+import org.gatein.wci.security.Credentials;
import org.gatein.wci.impl.DefaultServletContainerFactory;
import java.io.IOException;
@@ -62,7 +61,7 @@
HttpSession session = req.getSession();
// Looking for credentials stored in the session
- WCICredentials credentials =
(WCICredentials)session.getAttribute(WCICredentials.CREDENTIALS);
+ Credentials credentials =
(Credentials)session.getAttribute(Credentials.CREDENTIALS);
//
if (credentials == null)
@@ -75,7 +74,7 @@
if (token != null)
{
AbstractTokenService tokenService =
AbstractTokenService.getInstance(CookieTokenService.class);
- credentials = tokenService.validateToken(token, false).getWCICredentials();
+ credentials = tokenService.validateToken(token, false);
if (credentials == null)
{
log.debug("Login initiated with no credentials in session but found
token an invalid " + token + " " +
@@ -127,7 +126,7 @@
{
//Create token
AbstractTokenService tokenService =
AbstractTokenService.getInstance(CookieTokenService.class);
- String cookieToken = tokenService.createToken(new
Credentials(credentials));
+ String cookieToken = tokenService.createToken(credentials);
log.debug("Found a remember me request parameter, created a
persistent token " + cookieToken + " for it and set it up " +
"in the next response");
Deleted:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/Credentials.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/Credentials.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/Credentials.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -1,97 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.web.security;
-
-import org.gatein.wci.authentication.WCICredentials;
-
-import java.io.Serializable;
-
-/**
- * An immutable object that contains a username and a password.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-public class Credentials implements Serializable
-{
-
-
-
- /** . */
- private final String username;
-
- /** . */
- private final String password;
-
- /**
- * Construct a new instance.
- *
- * @param username the username value
- * @param password the password value
- * @throws NullPointerException if any argument is null
- */
- public Credentials(String username, String password) throws NullPointerException
- {
- if (username == null)
- {
- throw new NullPointerException("Username is null");
- }
- if (password == null)
- {
- throw new NullPointerException("Password is null");
- }
- this.username = username;
- this.password = password;
- }
-
- public Credentials(WCICredentials wciCredentials)
- {
- if (wciCredentials == null) {
- throw new IllegalArgumentException("wciCredentials is null");
- }
- this.username = wciCredentials.getUsername();
- this.password = wciCredentials.getPassword();
- }
-
- /**
- * Returns the username.
- *
- * @return the username
- */
- public String getUsername()
- {
- return username;
- }
-
- /**
- * Returns the password.
- *
- * @return the password
- */
- public String getPassword()
- {
- return password;
- }
-
- public WCICredentials getWCICredentials()
- {
- return new WCICredentials(username, password);
- }
-}
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/GateInToken.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/GateInToken.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/GateInToken.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -19,7 +19,9 @@
package org.exoplatform.web.security;
+import org.gatein.wci.security.Credentials;
+
/**
* Created by The eXo Platform SAS
* Author : Tan Pham Dinh
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/PortalLoginModule.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/PortalLoginModule.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/PortalLoginModule.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -25,6 +25,7 @@
import org.exoplatform.services.security.jaas.AbstractLoginModule;
import org.exoplatform.web.login.InitiateLoginServlet;
import org.exoplatform.web.security.security.CookieTokenService;
+import org.gatein.wci.security.Credentials;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.NameCallback;
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/Token.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/Token.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/Token.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.web.security;
+import org.gatein.wci.security.Credentials;
+
/**
* A token.
*/
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/TokenStore.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/TokenStore.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/TokenStore.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -19,6 +19,8 @@
package org.exoplatform.web.security;
+import org.gatein.wci.security.Credentials;
+
/**
* The token store is a place where temporary tokens are held.
*
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -25,9 +25,9 @@
import org.exoplatform.management.jmx.annotations.NameTemplate;
import org.exoplatform.management.jmx.annotations.Property;
import org.exoplatform.web.login.InitiateLoginServlet;
-import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.Token;
import org.exoplatform.web.security.TokenStore;
+import org.gatein.wci.security.Credentials;
import org.picocontainer.Startable;
import java.util.List;
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -25,8 +25,8 @@
import org.exoplatform.commons.chromattic.ContextualTask;
import org.exoplatform.commons.chromattic.SessionContext;
import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.GateInToken;
+import org.gatein.wci.security.Credentials;
import java.util.Collection;
import java.util.Date;
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenContainer.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenContainer.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenContainer.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -21,8 +21,8 @@
import org.chromattic.api.annotations.Create;
import org.chromattic.api.annotations.PrimaryType;
import org.chromattic.api.annotations.OneToMany;
-import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.GateInToken;
+import org.gatein.wci.security.Credentials;
import java.util.Collection;
import java.util.Date;
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenEntry.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenEntry.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TokenEntry.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -22,8 +22,8 @@
import org.chromattic.api.annotations.Name;
import org.chromattic.api.annotations.PrimaryType;
import org.chromattic.api.annotations.Property;
-import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.GateInToken;
+import org.gatein.wci.security.Credentials;
import java.util.Date;
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java
===================================================================
---
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -20,8 +20,8 @@
package org.exoplatform.web.security.security;
import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.GateInToken;
+import org.gatein.wci.security.Credentials;
import java.util.concurrent.ConcurrentHashMap;
Modified:
portal/branches/wci/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetToken.java
===================================================================
---
portal/branches/wci/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetToken.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetToken.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -1,8 +1,8 @@
package org.exoplatform.portal.gadget.core;
import org.apache.shindig.gadgets.oauth.OAuthStore.TokenInfo;
-import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.Token;
+import org.gatein.wci.security.Credentials;
public class GadgetToken extends TokenInfo implements Token
Modified:
portal/branches/wci/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenInfoService.java
===================================================================
---
portal/branches/wci/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenInfoService.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenInfoService.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -27,8 +27,8 @@
import org.exoplatform.commons.chromattic.ContextualTask;
import org.exoplatform.commons.chromattic.SessionContext;
import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.security.AbstractTokenService;
+import org.gatein.wci.security.Credentials;
import java.util.Collection;
Modified:
portal/branches/wci/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIForgetPassword.java
===================================================================
---
portal/branches/wci/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIForgetPassword.java 2010-10-06
11:01:49 UTC (rev 4536)
+++
portal/branches/wci/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIForgetPassword.java 2010-10-06
11:08:45 UTC (rev 4537)
@@ -27,7 +27,6 @@
import org.exoplatform.services.organization.Query;
import org.exoplatform.services.organization.User;
import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.web.security.Credentials;
import org.exoplatform.web.security.security.RemindPasswordTokenService;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -40,6 +39,7 @@
import org.exoplatform.webui.form.UIFormStringInput;
import org.exoplatform.webui.form.validator.EmailAddressValidator;
import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.gatein.wci.security.Credentials;
import java.net.URLEncoder;
import java.util.MissingResourceException;