Skip to content
Snippets Groups Projects
Commit 284d566c authored by Michael Simon's avatar Michael Simon
Browse files

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

parent 25257b11
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment