[portal-commits] JBoss Portal SVN: r9080 - in modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0: tools/etc/buildfragments and 1 other directory.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Fri Nov 23 06:32:49 EST 2007


Author: bdaw
Date: 2007-11-23 06:32:48 -0500 (Fri, 23 Nov 2007)
New Revision: 9080

Modified:
   modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/identity/src/main/org/jboss/portal/identity/auth/SynchronizingLoginModule.java
   modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/tools/etc/buildfragments/defaults.ent
Log:
SynchronizingLoginModule not injecting Principal objects for all the synchronized roles

Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/identity/src/main/org/jboss/portal/identity/auth/SynchronizingLoginModule.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/identity/src/main/org/jboss/portal/identity/auth/SynchronizingLoginModule.java	2007-11-23 09:05:27 UTC (rev 9079)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/identity/src/main/org/jboss/portal/identity/auth/SynchronizingLoginModule.java	2007-11-23 11:32:48 UTC (rev 9080)
@@ -65,8 +65,11 @@
    protected String userProfileModuleJNDIName;
    protected String preserveRoles;
 
+   private transient SimpleGroup userRoles = new SimpleGroup("Roles");
 
+   private transient String password;
 
+
    private UserModule userModule;
    private RoleModule roleModule;
    private MembershipModule membershipModule;
@@ -76,6 +79,7 @@
    {
       super.initialize(subject, callbackHandler, sharedState, options);
 
+      password = null;
 
       userModuleJNDIName = (String)options.get("userModuleJNDIName");
       roleModuleJNDIName = (String)options.get("roleModuleJNDIName");
@@ -159,24 +163,26 @@
    }
 
    /**
-    * We must implement this - just return "" - it's ok as we override validatePassword
+    * We must implement this
     * @return
     * @throws LoginException
     */
    protected String getUsersPassword() throws LoginException
    {
-      return "";
+      return password;
    }
 
 
    /**
     * This always returns true - so this module always pass.
-    * @param string
+    * @param inputPassword
     * @param string1
     * @return
     */
-   protected boolean validatePassword(String string, String string1)
+   protected boolean validatePassword(String inputPassword, String string1)
    {
+      // Save the password for the synchro stuff
+      password = inputPassword;
       return true;
    }
 
@@ -188,12 +194,12 @@
 
    protected Group[] getRoleSets() throws LoginException
    {
-      Group group = new SimpleGroup("Roles");
+      //Group group = new SimpleGroup("Roles");
       if (additionalRole != null)
       {
          try
          {
-            group.addMember(createIdentity(additionalRole));
+            userRoles.addMember(createIdentity(additionalRole));
          }
          catch (Exception e)
          {
@@ -201,7 +207,9 @@
             log.error("Error when adding additional role: ", e);
          }
       }
-      return new Group[]{group};
+
+      Group[] roleSets = {userRoles};
+      return roleSets;
    }
 
 
@@ -237,8 +245,6 @@
             {
                try
                {
-
-
                   User user = null;
                   //check if user exist
                   try
@@ -337,6 +343,7 @@
                            }
 
                            rolesToAssign.add(role);
+                           userRoles.addMember(createIdentity(role.getName()));
                         }
                      }
                   }
@@ -346,6 +353,7 @@
                      try
                      {
                         rolesToAssign.add(getRoleModule().findRoleByName(defaultAssignedRole));
+                        userRoles.addMember(createIdentity(defaultAssignedRole));
                      }
                      catch(Exception e)
                      {
@@ -363,6 +371,10 @@
                         if (presentRoles != null)
                         {
                            rolesToAssign.addAll(presentRoles);
+                           for (Object presentRole : presentRoles)
+                           {
+                              userRoles.addMember(createIdentity(((Role)presentRole).getName()));
+                           }
                         }
                      }
 

Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/tools/etc/buildfragments/defaults.ent
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/tools/etc/buildfragments/defaults.ent	2007-11-23 09:05:27 UTC (rev 9079)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0_0/tools/etc/buildfragments/defaults.ent	2007-11-23 11:32:48 UTC (rev 9080)
@@ -118,8 +118,8 @@
   <property name="javac.depend.cachedir" value="${build.cache}/depends"/>
 
 
-  <property name="javac.source" value="1.4"/>
-  <property name="javac.target" value="1.4"/>
+  <property name="javac.source" value="1.5"/>
+  <property name="javac.target" value="1.5"/>
   <property name="rmic.stubVersion" value="1.2"/>
 
   <!-- classpath and local.classpath must have a value using with a path -->




More information about the portal-commits mailing list