<div dir="ltr">Hello,<div>In order to migrate from 3.4.1 to version 4, I'm migrating an old custom dataconnector to the HTTP connector.</div><div>I have configured my httpclient security in conf/global.xml:</div><div><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"JetBrains Mono",monospace"><span style="color:rgb(232,191,106)"><bean </span><span style="color:rgb(186,186,186)">id</span><span style="color:rgb(106,135,89)">="HttpSecurity" </span><span style="color:rgb(186,186,186)">class</span><span style="color:rgb(106,135,89)">="org.opensaml.security.httpclient.HttpClientSecurityParameters"</span><span style="color:rgb(232,191,106)">><br></span><span style="color:rgb(232,191,106)">    <property </span><span style="color:rgb(186,186,186)">name</span><span style="color:rgb(106,135,89)">="basicCredentials"</span><span style="color:rgb(232,191,106)">><br></span><span style="color:rgb(232,191,106)">        <bean </span><span style="color:rgb(186,186,186)">class</span><span style="color:rgb(106,135,89)">="org.apache.http.auth.UsernamePasswordCredentials"<br></span><span style="color:rgb(106,135,89)">              </span><span style="color:rgb(152,118,170)">c</span><span style="color:rgb(186,186,186)">:_0</span><span style="color:rgb(106,135,89)">="%{username}" </span><span style="color:rgb(152,118,170)">c</span><span style="color:rgb(186,186,186)">:_1</span><span style="color:rgb(106,135,89)">="%{password}" </span><span style="color:rgb(232,191,106)">/><br></span><span style="color:rgb(232,191,106)">    </property><br></span><span style="color:rgb(232,191,106)"></bean></span></pre></div><div>In the attribute resolver I have set an HTTP dataconnector inspired from the documentation:</div><div><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"JetBrains Mono",monospace"> <span style="color:rgb(232,191,106)"><</span><span style="color:rgb(152,118,170)">resolver</span><span style="color:rgb(232,191,106)">:DataConnector<br></span><span style="color:rgb(232,191,106)">                </span><span style="color:rgb(186,186,186)">id</span><span style="color:rgb(106,135,89)">="WS" </span><span style="color:rgb(152,118,170)">xsi</span><span style="color:rgb(186,186,186)">:type</span><span style="color:rgb(106,135,89)">="HTTP"<br></span><span style="color:rgb(106,135,89)">                </span><span style="color:rgb(186,186,186)">httpClientRef</span><span style="color:rgb(106,135,89)">="shibboleth.MemoryCachingHttpClient"<br></span><span style="color:rgb(106,135,89)">                </span><span style="color:rgb(186,186,186)">httpClientSecurityParametersRef</span><span style="color:rgb(106,135,89)">="HttpSecurity"<br></span><span style="color:rgb(106,135,89)">        </span><span style="color:rgb(232,191,106)">><br></span><span style="color:rgb(232,191,106)">        <</span><span style="color:rgb(152,118,170)">resolver</span><span style="color:rgb(232,191,106)">:Dependency </span><span style="color:rgb(186,186,186)">ref</span><span style="color:rgb(106,135,89)">="LDAP" </span><span style="color:rgb(232,191,106)">/><br></span><span style="color:rgb(232,191,106)">        <URLTemplate></span>%{service.endpoint}/${uid.get(0)}<span style="color:rgb(232,191,106)"></URLTemplate><br></span><span style="color:rgb(128,128,128)">       </span><span style="color:rgb(232,191,106)"><ResponseMapping><br></span><span style="color:rgb(232,191,106)">            <Script><br></span><span style="color:rgb(232,191,106)">                </span><![CDATA[<br>        var HashSet = Java.type("java.util.HashSet");<br>        var HttpClientSupport = Java.type("net.shibboleth.utilities.java.support.httpclient.HttpClientSupport");<br>        var IdPAttribute = Java.type("net.shibboleth.idp.attribute.IdPAttribute");<br>        var StringAttributeValue = Java.type("net.shibboleth.idp.attribute.StringAttributeValue");<br><br>        // Limits length to 64k<br>        var body = HttpClientSupport.toString(response.getEntity(), "UTF-8", 65536);<br>        var result = JSON.parse(body);<br><br>        var attr = new IdPAttribute("group");<br>        var values = new HashSet();<br>        if (result.groups != null) {<br>            for (var i=0; i<result.groups.length; i++) {<br>                values.add(new StringAttributeValue(result.groups[i].name));<br>            }<br>        }<br>        attr.setValues(values);<br>        connectorResults.add(attr);<br>        ]]><br>            <span style="color:rgb(232,191,106)"></Script><br></span><span style="color:rgb(232,191,106)">        </ResponseMapping><br></span><span style="color:rgb(232,191,106)"><br></span><span style="color:rgb(232,191,106)">        <ResultCache </span><span style="color:rgb(186,186,186)">expireAfterWrite</span><span style="color:rgb(106,135,89)">="PT5M"</span><span style="color:rgb(232,191,106)">/><br></span><span style="color:rgb(232,191,106)">    </</span><span style="color:rgb(152,118,170)">resolver</span><span style="color:rgb(232,191,106)">:DataConnector><br></span></pre></div><div>Unfortunately, while I can see the call to the service.endpoint url, there is no basic credentials provided in the request and I receive a 401 from the service endpoint.</div><div>Is there something else to do to have basic authentication working with http connector ?</div><div>Best Regards,</div><div>Claude</div><div><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"JetBrains Mono",monospace"></pre></div></div>