ausaccessfed/federationregistry — pull request #141 by bradleybeddoes (2013-09-19 01:55:01+00:00)
Title: Metadata: Metadata breaks for SP requesting only eduPersonEntitlement with no value

Hi Bradley,

I was looking at the code changes in #128 and #129 - and I looked into the source code and found an edge-case that would break the metadata.

The current code says to generate an AssertionConsumingService if there are approved attributes. But it does not fully align with the condition for generating attributes - eduPersonEntitlement with no value counts in the first condition but does not get generated.

Results into xmlsectool reporting:
```
org.xml.sax.SAXParseException: cvc-complex-type.2.4.b: The content of element 'AttributeConsumingService' is not complete. One of '{"urn:oasis:names:tc:SAML:2.0:metadata":ServiceName, "urn:oasis:names:tc:SAML:2.0:metadata":ServiceDescription, "urn:oasis:names:tc:SAML:2.0:metadata":RequestedAttribute}' is expected.
```

This might ask for a more through audit of the metadata generation call hierarchy - to see whether the conditions on generating a containing element fully align with the conditions of the contained element.

Cheers,
Vlad