User: starksm
Date: 01/04/12 21:38:01
Modified: src/main/org/jboss/security/plugins/samples Tag: Branch_2_2
IdentityLoginModule.java RolesLoginModule.java
UsernamePasswordLoginModule.java
Log:
Fix problem with modules sharing of the user identity.
Sourceforge BugID: 415818
Revision Changes Path
No revision
No revision
1.3.2.1 +2 -2
jbosssx/src/main/org/jboss/security/plugins/samples/IdentityLoginModule.java
Index: IdentityLoginModule.java
===================================================================
RCS file:
/cvsroot/jboss/jbosssx/src/main/org/jboss/security/plugins/samples/IdentityLoginModule.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- IdentityLoginModule.java 2001/03/29 02:27:12 1.3
+++ IdentityLoginModule.java 2001/04/13 04:38:01 1.3.2.1
@@ -25,7 +25,7 @@
@see org.jboss.security.SimplePrincipal
@author [EMAIL PROTECTED]
-@version $Revision: 1.3 $
+@version $Revision: 1.3.2.1 $
*/
public class IdentityLoginModule extends AbstractServerLoginModule
{
@@ -54,7 +54,7 @@
Principal principal = new SimplePrincipal(principalName);
subject.getPrincipals().add(principal);
// Put the principal into the sharedState map
- sharedState.put("javax.security.auth.login.name", principal);
+ sharedState.put("javax.security.auth.login.name", principalName);
return true;
}
1.3.2.1 +6 -5
jbosssx/src/main/org/jboss/security/plugins/samples/RolesLoginModule.java
Index: RolesLoginModule.java
===================================================================
RCS file:
/cvsroot/jboss/jbosssx/src/main/org/jboss/security/plugins/samples/RolesLoginModule.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- RolesLoginModule.java 2001/03/29 02:27:12 1.3
+++ RolesLoginModule.java 2001/04/13 04:38:01 1.3.2.1
@@ -36,7 +36,7 @@
@deprecated See the JaasServerLoginModule which has incorporated this behavior.
@author [EMAIL PROTECTED]
-@version $Revision: 1.3 $
+@version $Revision: 1.3.2.1 $
*/
public class RolesLoginModule implements LoginModule
{
@@ -81,12 +81,10 @@
// Get the username.Roles for the 'Roles' group
String key = username + ".Roles";
userRoles = createGroup(key, "Roles", principals);
- principals.add(userRoles);
// Get the username.CallerPrincipal for the 'CallerPrincipal' group
key = username + ".CallerPrincipal";
callerPrincipal = createGroup(key, "CallerPrincipal", principals);
- principals.add(callerPrincipal);
}
else
{
@@ -131,7 +129,10 @@
}
if( group == null )
+ {
group = new SimpleGroup(name);
+ principals.add(group);
+ }
String value = roles.getProperty(key);
if( value != null )
{
@@ -139,8 +140,8 @@
while( tokenizer.hasMoreTokens() )
{
String token = tokenizer.nextToken();
- SimplePrincipal p = new SimplePrincipal(token);
- group.addMember(p);
+ SimpleGroup g = new SimpleGroup(token);
+ group.addMember(g);
}
}
return group;
1.1.2.1 +1 -1
jbosssx/src/main/org/jboss/security/plugins/samples/UsernamePasswordLoginModule.java
Index: UsernamePasswordLoginModule.java
===================================================================
RCS file:
/cvsroot/jboss/jbosssx/src/main/org/jboss/security/plugins/samples/UsernamePasswordLoginModule.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- UsernamePasswordLoginModule.java 2001/03/29 02:27:13 1.1
+++ UsernamePasswordLoginModule.java 2001/04/13 04:38:01 1.1.2.1
@@ -37,7 +37,7 @@
@see #getUsersRoles()
@author [EMAIL PROTECTED]
-@version $Revision: 1.1 $
+@version $Revision: 1.1.2.1 $
*/
public abstract class UsernamePasswordLoginModule extends AbstractServerLoginModule
{
@@ -89,7 +89,7 @@
if( getUseFirstPass() == true )
{ // Add the username and password to the shared state map
- sharedState.put("javax.security.auth.login.name", identity);
+ sharedState.put("javax.security.auth.login.name", username);
sharedState.put("javax.security.auth.login.password", credential);
}
return true;
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development