1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.opensaml.saml2.metadata.impl;
22
23 import org.opensaml.saml2.core.Attribute;
24 import org.opensaml.saml2.metadata.AssertionIDRequestService;
25 import org.opensaml.saml2.metadata.AttributeProfile;
26 import org.opensaml.saml2.metadata.IDPSSODescriptor;
27 import org.opensaml.saml2.metadata.NameIDMappingService;
28 import org.opensaml.saml2.metadata.SingleSignOnService;
29 import org.opensaml.xml.XMLObject;
30 import org.opensaml.xml.io.UnmarshallingException;
31 import org.opensaml.xml.schema.XSBooleanValue;
32 import org.w3c.dom.Attr;
33
34
35
36
37 public class IDPSSODescriptorUnmarshaller extends SSODescriptorUnmarshaller {
38
39
40 protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
41 IDPSSODescriptor descriptor = (IDPSSODescriptor) parentObject;
42
43 if (childObject instanceof SingleSignOnService) {
44 descriptor.getSingleSignOnServices().add((SingleSignOnService) childObject);
45 } else if (childObject instanceof NameIDMappingService) {
46 descriptor.getNameIDMappingServices().add((NameIDMappingService) childObject);
47 } else if (childObject instanceof AssertionIDRequestService) {
48 descriptor.getAssertionIDRequestServices().add((AssertionIDRequestService) childObject);
49 } else if (childObject instanceof AttributeProfile) {
50 descriptor.getAttributeProfiles().add((AttributeProfile) childObject);
51 } else if (childObject instanceof Attribute) {
52 descriptor.getAttributes().add((Attribute) childObject);
53 } else {
54 super.processChildElement(parentObject, childObject);
55 }
56 }
57
58
59 protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
60 IDPSSODescriptor descriptor = (IDPSSODescriptor) samlObject;
61
62 if (attribute.getLocalName().equals(IDPSSODescriptor.WANT_AUTHN_REQ_SIGNED_ATTRIB_NAME)) {
63 descriptor.setWantAuthnRequestsSigned(XSBooleanValue.valueOf(attribute.getValue()));
64 } else {
65 super.processAttribute(samlObject, attribute);
66 }
67 }
68 }