portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r591258 - in /portals/jetspeed-2/trunk/components: jetspeed-portal/src/main/java/org/apache/jetspeed/login/filter/PortalFilter.java jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserSubjectPrincipalImpl.java
Date Fri, 02 Nov 2007 08:33:11 GMT
Author: ate
Date: Fri Nov  2 01:33:10 2007
New Revision: 591258

URL: http://svn.apache.org/viewvc?rev=591258&view=rev
Log:
When creating a Subject, all of its principals need to be provided at construction time through
its PrincipalsSet parameter.
Als only the members of the PrincipalsSet are taken, adding a Principal later to this set
has no effect anymore.

Modified:
    portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/filter/PortalFilter.java
    portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserSubjectPrincipalImpl.java

Modified: portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/filter/PortalFilter.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/filter/PortalFilter.java?rev=591258&r1=591257&r2=591258&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/filter/PortalFilter.java
(original)
+++ portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/filter/PortalFilter.java
Fri Nov  2 01:33:10 2007
@@ -37,14 +37,12 @@
 import org.apache.jetspeed.administration.PortalConfiguration;
 import org.apache.jetspeed.audit.AuditActivity;
 import org.apache.jetspeed.login.LoginConstants;
-import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.SecurityHelper;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.UserManager;
 import org.apache.jetspeed.security.UserPrincipal;
 import org.apache.jetspeed.security.impl.PrincipalsSet;
-import org.apache.jetspeed.security.impl.UserPrincipalImpl;
 import org.apache.jetspeed.security.impl.UserSubjectPrincipalImpl;
 
 public class PortalFilter implements Filter
@@ -93,14 +91,14 @@
                     }
                     catch (SecurityException sex)
                     {
-                        subject = null;
                     }       
                     if (subject == null)
                     {
                         Set principals = new PrincipalsSet();
-                        subject = new Subject(true, principals, new HashSet(), new HashSet());
-                        UserPrincipal userPrincipal = new UserSubjectPrincipalImpl(username,
subject);
+                        UserSubjectPrincipalImpl userPrincipal = new UserSubjectPrincipalImpl(username);
                         principals.add(userPrincipal);
+                        subject = new Subject(true, principals, new HashSet(), new HashSet());
+                        userPrincipal.setSubject(subject);
                     }
                     Principal principal = SecurityHelper.getPrincipal(subject, UserPrincipal.class);
                     sRequest = wrapperRequest(request, subject, principal);

Modified: portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserSubjectPrincipalImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserSubjectPrincipalImpl.java?rev=591258&r1=591257&r2=591258&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserSubjectPrincipalImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/impl/UserSubjectPrincipalImpl.java
Fri Nov  2 01:33:10 2007
@@ -37,12 +37,15 @@
      * <p>The user principal constructor.</p>
      * @param userName The user principal name.
      */
-    public UserSubjectPrincipalImpl(String userName, Subject subject)
+    public UserSubjectPrincipalImpl(String userName)
     {
         super(userName);   
-        this.subject = subject;
     }
-
+
+    public void setSubject(Subject subject)
+    {
+        this.subject = subject;
+    }
     
     public Subject getSubject()
     {



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message