Commit 284d566c authored by michael.simon's avatar michael.simon
Browse files

Support SAML Attribute Values without excplicit xsi:type. #43

parent 25257b11
......@@ -39,6 +39,7 @@ import org.opensaml.xml.io.UnmarshallerFactory;
import org.opensaml.xml.io.UnmarshallingException;
import org.opensaml.xml.parse.BasicParserPool;
import org.opensaml.xml.parse.XMLParserException;
import org.opensaml.xml.schema.XSAny;
import org.opensaml.xml.schema.XSDateTime;
import org.opensaml.xml.schema.XSString;
import org.opensaml.xml.util.XMLHelper;
......@@ -133,6 +134,19 @@ public class SamlHelper implements Serializable {
else if (obj instanceof XSDateTime) {
returnList.add(((XSDateTime) obj).getValue());
}
/*
* Support Attributes with no encoded type. They come as XSAny.
* Assume it's a string
*/
else if (obj instanceof XSAny) {
XSAny any = (XSAny) obj;
if (any.getTextContent() != null) {
returnList.add(any.getTextContent().trim());
}
}
else {
logger.info("Unknown Attribute type: {}", obj.getClass());
}
}
}
return returnList;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment