Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.2.1
-
None
Description
When using org.apache.shiro.cas.CasRealm, if the SAML returned by CAS contains multiple attributes of the same name (e.g. roles?), CasRealm blows up in doGetAuthorizationInfo
String value = attributes.get(attributeName);
with
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
This is because the org.jasig.cas.client.validation.Saml11TicketValidator is populating the attributes in the
principal as follows:
personAttributes.put(samlAttribute.getName(), values.size() == 1 ? values.get(0) : values);
See attached patch for a fix