Unable to resolve XML error when creating a scripted Attribute

Paul McConkey paul.mcconkey at cambridgeimaging.co.uk
Fri Mar 1 13:25:15 EST 2013


I am trying to implement an attribute definition that will set
EduPersonAffiliation according to group membership within my Active
Directory.

I have installed IdPQuickInstall and everything is working fine. I
originally followed the  example
<https://wiki.shibboleth.net/confluence/display/SHIB2/ResolverScriptAttributeDefinitionExamples#ResolverScriptAttributeDefinitionExamples-GenerateAffiliationbasedonGroups>  
on the Shibboleth wiki to add a scripted EduPersonAffiliation attribute, but
I repeatedly get an error when the IdP starts up:

ERROR [edu.internet2.middleware.shibboleth.common.config.BaseService:188] -
Configuration was not loaded for shibboleth.AttributeResolver service, error
creating components.  The root cause of this error was:
org.xml.sax.SAXParseException: cvc-complex-type.2.3: Element
'resolver:AttributeDefinition' cannot have character [children], because the
type's content type is element-only.

I understand that this is some kind of XML schema syntax error but I don't
know enough to know what it means.

I have reduced the attribute definition to the minimum in order to try and
debug it and it now looks like this:

<resolver:AttributeDefinition xsi:type="Script"
xmlns="urn:mace:shibboleth:2.0:resolver:ad" id="eduPersonAffiliation">
        <resolver:Dependency ref="myLDAP" />
		<resolver:DisplayName xml:lang="en">Affiliation
type</resolver:DisplayName>
        <resolver:AttributeEncoder xsi:type="enc:SAML1String"
name="urn:mace:dir:attribute-def:eduPersonAffiliation" />
        <resolver:AttributeEncoder xsi:type="enc:SAML2String"
name="urn:oid:1.3.6.1.4.1.5923.1.1.1.1" friendlyName="eduPersonAffiliation"
/>

		<Script>
		<[CDATA[
		
importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);
	 
	 		eduPersonAffiliation = new BasicAttribute("eduPersonAffiliation");
	                eduPersonAffiliation.getValues().add("affiliate");
		]]>
		<Script>
    </resolver:AttributeDefinition>

(NB the ! is removed from the <[CDATA[ line so that the mailing list doesn't
remove the script)

If I remove the dependency line, the IdP service starts with no errors. That
would be fine for the script above, but the real script needs to refer to
LDAP values.

Does anyone have any pointers?

Thanks,

Paul.



--
View this message in context: http://shibboleth.1660669.n2.nabble.com/Unable-to-resolve-XML-error-when-creating-a-scripted-Attribute-tp7585046.html
Sent from the Shibboleth - Users mailing list archive at Nabble.com.


More information about the users mailing list