Custom attribute resolver IdPv4
Sam Jones
sam at mimoto.co.uk
Tue Feb 23 15:18:54 UTC 2021
Hello,
I'm having some trouble developing a custom attribute resolver for IdPv4 by
following the documentation here:
https://wiki.shibboleth.net/confluence/display/IDP4/Developing+Attribute+Resolver+Extensions
I have:
* Extended the AbstractDataConnector as mentioned in the documentation.
* Implemented the doDataConnectorResolve method, again as described in the doc.
* Created a schema to describe the connector in the resources/schema directory of the source tree.
* Added a spring.schemas to META-INF to map the schema name to the file.
* Published the schema at it's https location.
* Extended the AbstractDataConnectorParser.
* Extended the BaseAttributeDefinitionParser.
* Packaged the above and put the resultant jar in shibboleth-idp/edit-webapp/WEB-INF/lib/
* Rebuilt the shibboleth war.
* Added the custom name space and configured the custom data connector in attribute-resolver.xml
This results in the following error at startup:
ERROR [net.shibboleth.utilities.java.support.service.AbstractReloadableService:232] - Service 'shibboleth.AttributeRegistryService': Reload for shibboleth.AttributeRegistryService failed
net.shibboleth.utilities.java.support.service.ServiceException: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 12 in XML document from file [/opt/shibboleth-idp/conf/attribute-resolver.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 89; cvc-complex-type.2.4.a: Invalid content was found starting with element '{"https://mimoto.co.uk/custom-dc/mimoto-custom-data-connector.xsd":DataConnector}'. One of '{"urn:mace:shibboleth:2.0:resolver":AttributeDefinition, "urn:mace:shibboleth:2.0:resolver":DataConnector}' is expected.
That line in the attribute-resolver is :
<custom:DataConnector id="CustomDataConnector" xsi:type="CustomDataConnector" />
( The leading whitespace means character 89 refers to the ">" at the end):
I'll also mention the AttributeResolver opening tag because I feel it is useful context information:
<AttributeResolver
xmlns="urn:mace:shibboleth:2.0:resolver"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:custom="https://mimoto.co.uk/custom-dc/mimoto-custom-data-connector.xsd"
xsi:schemaLocation="urn:mace:shibboleth:2.0:resolver http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd
https://mimoto.co.uk/custom-dc/mimoto-custom-data-connector.xsd https://mimoto.co.uk/custom-dc/mimoto-custom-data-connector.xsd">
I know that the IdP is reading the schema for the custom data connector because
if I do not publish it to that url, or deliberately introduce a syntax error in
the xsd, I see an exception.
I've tried a number of things to try and resolve this but I do not appear to
making much progress. I'd be grateful for any hints/ideas anyone could provide.
I've put the source tree that I'm working with here:
https://github.com/mimoto/example-data-connector
All the best,
Sam Jones.
More information about the dev
mailing list