Author: anil.saldhana(a)jboss.com
Date: 2011-06-13 21:14:09 -0400 (Mon, 13 Jun 2011)
New Revision: 1002
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java
Log:
deal with roles from saml assertion
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java 2011-06-14
00:02:59 UTC (rev 1001)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java 2011-06-14
01:14:09 UTC (rev 1002)
@@ -792,13 +792,15 @@
roleKeys.addAll(StringUtil.tokenize(roleKey));
List<String> roles = AssertionUtil.getRoles(assertion, roleKeys);
-
- SimpleGroup group = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
- for (String role : roles)
+ if (roles.size() > 0)
{
- group.addMember(new SimplePrincipal(role));
+ SimpleGroup group = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
+ for (String role : roles)
+ {
+ group.addMember(new SimplePrincipal(role));
+ }
+ subject.getPrincipals().add(group);
}
- subject.getPrincipals().add(group);
}
if (injectCallerPrincipalGroup)
Show replies by date