Multiple ldap DataConnectors returning attributes wit the same name
Douglas E. Engert
deengert at anl.gov
Tue Jun 11 10:12:32 EDT 2013
OK, thanks, I see it can be done.
I was hoping that there might be an option
like <ReturnAttributes prefix="other-">
that would prefix the BasicAttribute name for each of the
attributes to be returned from this LDAP dataConnector.
Could you consider such a modification for a future release?
On 6/10/2013 4:47 PM, Daniel Fisher wrote:
> On Mon, Jun 10, 2013 at 3:17 PM, Douglas E. Engert <deengert at anl.gov <mailto:deengert at anl.gov>> wrote:
>
>
>
> On 6/5/2013 5:14 PM, Cantor, Scott wrote:
> > On 6/5/13 4:02 PM, "Douglas E. Engert" <deengert at anl.gov <mailto:deengert at anl.gov>> wrote:
> >>
> >> I would like to have two LDAP DataConnectors that both need to return a
> >> CN attribute.
> >> How can I have one return CN as the attribute and the other return some
> >> other name so the two attributes don't get mixed up?
> >>
> >> I may be missing something simple, but is there a way to add a prefix
> >> to the name of the attributes listed in one of the <ReturnAttributes>
> >
> > Not that I'm aware (if there is Daniel will know, or you'll find something
> > in the vt-ldap docs about it). There definitely is nothing in the IdP
> > itself.
>
> Did not find any info in their docs, and no one from vt-ldap has responded.
>
>
> You can write a search result handler to copy the ldap attribute:
>
> {code}
> public class CopyCnSearchResultHandler extends CopySearchResultHandler
> {
> protected Attributes processAttributes(
> final SearchCriteria sc,
> final SearchResult sr)
> throws NamingException
> {
> final Attributes newAttrs = sr.getAttributes();
> if (newAttrs.get("cn") != null) {
> final Attribute attr = newAttrs.get("cn");
> final Attribute newAttr = new BasicAttribute("copy-cn", attr.isOrdered());
> final NamingEnumeration<?> en = attr.getAll();
> while (en.hasMore()) { newAttr.add(en.next()); }
> newAttrs.put(newAttr);
> }
> return newAttrs;
> }
> }
> {code}
>
> Then add your handler as a property in your resolver configuration:
>
> <LDAPProperty
> name="edu.vt.middleware.ldap.searchResultHandlers"
>
> value="edu.vt.middleware.ldap.handler.FqdnSearchResultHandler,edu.vt.middleware.ldap.handler.EntryDnSearchResultHandler,edu.vt.middleware.ldap.handler.BinarySearchResultHandler,CopyCnSearchResultHandler"/>
>
> Note that setting this property overrides the existing result handler configuration, which is why I added them back in addition to the copy cn handler.
> If you are using the mergeResults or lowercasing options, those handlers must be added as well.
>
> --Daniel Fisher
>
>
>
> --
> To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net
>
--
Douglas E. Engert <DEEngert at anl.gov>
Argonne National Laboratory
9700 South Cass Avenue
Argonne, Illinois 60439
(630) 252-5444
More information about the users
mailing list