This project has moved. For the latest updates, please go here.

How can I configure in the LDAPC custom the 'Display value' to be shown in the picker?

Oct 15, 2015 at 11:20 AM
Hello,

I wonder how I can configure in the 'LDAPC custom' the 'Display value' to be shown in the picker?

Thanks for any help.
Claude
Coordinator
Oct 15, 2015 at 11:52 AM
Hello Claude,

In overridden method SetCustomConfiguration, when you define collection "this.CurrentConfiguration.AttributesListProp", for each AttributeHelper object that you add you can define which LDAP attribute to display in property "LDAPAttributeToDisplayProp".
In example below, WindowsAccountName permissions are created with LDAP attribute "sAMAccountName" but people picker will display LDAP attribute "cn":
new AttributeHelper{LDAPAttribute="sAMAccountName", LDAPObjectClassProp="user", ClaimType=WIF.ClaimTypes.WindowsAccountName, ClaimEntityType = SPClaimEntityTypes.User, AdditionalLDAPFilterProp="(!(objectClass=computer))", LDAPAttributeToDisplayProp="cn"}
I also set property AdditionalLDAPFilterProp to show you what I meant with my answer on previous thread about possibilities to set an LDAP filter at LDAP attribute level.

thanks,
Yvan
Oct 15, 2015 at 1:11 PM
Hello Yvand,

Many thanks for your help on this.

I can see now how and where to use those 'new AttributeHelper'.

A question remains, I have 3 times the 'override void SetCustomConfiguration' method in the custom code, but being in Attach debug mode in visstudio it seems this part of code is never called when I manipulate the people picker... do you have an idea why?

Kind regards.
Claude
Coordinator
Oct 16, 2015 at 11:18 AM
Hello,
I'm not sure I understand what you mean with "I have 3 times the 'override void SetCustomConfiguration' method in the custom code", you can override the method only once in an inherited class...
thanks,
Yvan
Oct 22, 2015 at 10:29 AM
Edited Oct 22, 2015 at 10:30 AM
Hello Yvand,

I'm still trying to make the picker displaying 'displayName'. I added at the end on the config list:
  this.CurrentConfiguration.AttributesListProp = new List<AttributeHelper>: ->
"LDAPAttributeToDisplayProp="displayName"" but still remains the email showed. I'd like to have justr the display name. Any suggestion?

Thank you.
Claude

code
I changed the last line of attributeHelper:
        this.CurrentConfiguration.AttributesListProp = new List<AttributeHelper>
        {
...
            new AttributeHelper{LDAPAttribute="sAMAccountName", LDAPObjectClassProp="user", ClaimType=WIF.ClaimTypes.WindowsAccountName, ClaimEntityType = SPClaimEntityTypes.User, AdditionalLDAPFilterProp="(!(objectClass=computer))", LDAPAttributeToDisplayProp="displayName"}
        };
Oct 22, 2015 at 10:55 AM
Edited Oct 22, 2015 at 11:06 AM
Ok I placed "LDAPAttributeToDisplayProp="displayName" at the end of each property, now the display name is showed.

Remains in parenthesis the prop used to find the user (email). I'd like to hide this, I found in the code:
        // If input is resolved by an attribute linked to identity claim type (typically displayName and cn attributes), show its value in parenthesis.
        this.CurrentConfiguration.DisplayLdapMatchForIdentityClaimTypeProp = true;

I changed it to false, but the parenthesis stuff remains.

Is there another place to modify something to hide this?

Thank you.
Claude

I'll create a new thread for the parenthesis stuff
Marked as answer by csiefers on 10/22/2015 at 4:06 AM