Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add required change to attribute-resolver.xml file. Update QNAME to SCHEMA_NAME.

...

Code Block
public class MyDataConnectorBeanDefinitionParser  extends BaseDataConnectorBeanDefinitionParser {

    public static final QName QNAMESCHEMA_NAME = new QName(MyDataConnectorNamespaceHandler.NAMESPACE, "UserLookup");

    protected Class getBeanClass(Element element) {
        return MyDataConnectorFactoryBean.class;
    }


    protected void doParse(Element element, BeanDefinitionBuilder builder) {
        super.doParse(element, builder);
        String lookupUrl = pluginConfig.getAttributeNS(null, "lookupUrl");
        builder.addPropertyValue("lookupUrl", lookupUrl);
    }
}

...

Code Block
public class MyDataConnectorNamespaceHandler extends BaseSpringNamespaceHandler {

    public static String NAMESPACE = "urn:example.org:shibboleth:2.0:resolver";

    public void init() {
        registerBeanDefinitionParser(MyDataConnectorBeanDefinitionParser.QNAMESCHEMA_NAME,
                                    new MyDataConnectorBeanDefinitionParser());
    }
}

...

Code Block
urn\:example.org\:shibboleth\:2.0\:resolver =  com.example.shibboleth.MyDataConnectorNamespaceHandler

attribute-resolver.xml File

Now you can make use of your DataConnector via atribute-resolver.xml.

Declare your name space, add your XML schema file to the documents schemaLocation and add your DataConnector:

Code Block

<ProfileHandlerGroup xmlns="urn:mace:shibboleth:2.0:idp:profile-handler"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xmlns:example="http://example.org/shibboleth/authn"
                     xsi:schemaLocation="urn:mace:shibboleth:2.0:idp:profile-handler classpath:/schema/shibboleth-2.0-idp-profile-handler.xsd
                     urn:example.org:shibboleth:2.0:resolver classpath:/schema/myConnectors.xsd">
[..]
    <resolver:DataConnector id="userLookupAttributes" xsi:type="UserLookup" xmlns="urn:example.org:shibboleth:2.0:resolver">
        <lookupUrl>http://data.example.org</lookupUrl>
    </resolver:DataConnector>