This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (5 pts)
8 Replies Last post: Jun 6, 2008 9:32 AM by Christian Flickinger  
Brian Provenzano Bronze 7 posts since
Feb 21, 2008
Currently Being Moderated

Mar 4, 2008 9:35 AM

LDAP + Contact Display Name

 

We currently use LDAP for our users and groups and everything has been working fine.  However, I would like to be able to add each Contact's phone extension to the end of thier displayname in the Spark Contact list (as it shows in Spark).  It seems that you should be able to go into the LDAP setup and for the fields "Name" and/or "Full Name" append the telephone attribute to the current attribute as such:  instead of "" have it read " ".  But,  it seems when I do this it does not affect the name displayed in the contact list is Spark.  I have tried refreshing the server cache and still no go.  Is this even possible?  What value is being used to populate the Contact list?

 

 

Openfire Enterprise v 3.4.5

JVM 1.5

Linux

LDAP: Fedora Directory Server 1.x

 

 

My openfire.xml is below (usernames/passwords removed):

 

 




<?xml version="1.0" encoding="UTF-8"?>

<!--
    This file stores bootstrap properties needed by Wildfire.
    Property names must be in the format: "prop.name.is.blah=value"
    That will be stored as:
        <prop>
            <name>
             & nbsp;  <is>
             & nbsp;      <blah>value</blah>
             & nbsp;  </is>
            </name>
        </prop>

    Most properties are stored in the Wildfire database. A
        property viewer and editor is included in the admin console.
-->
<!-- root element, all properties must be under this element -->
<jive>
  <adminConsole>
    <!-- Disable either port by setting the value to -1 -->
    <port>9090</port>
    <securePort>9091</securePort>
  </adminConsole>
  <admin>
    <!-- Use this section to define users that will have admin privileges. Below,
          you will find two ways to specify which users are admins. Admins will
          have access to the admin console (only local users) and may have also access
          to other functionalities like ad-hoc commands. -->
    <!-- By default, only the user with the username "admin" can login
         to the admin console. Alternatively, you can specify a comma-delimitted
         list usernames that should be authorized to login to the admin console
         by setting the <authorizedUsernames> field below. -->
    <!-- <authorizedUsernames></authorizedUsernames> -->
    <!-- Comma-delimitted list of bare JIDs. The JIDs may belong to local
         or remote users. -->
    <!-- <authorizedJIDs></authorizedJIDs> -->
    <authorizedUsernames>admin</authorizedUsernames>
  </admin>
  <locale>en</locale>
  <!-- Network settings. By default, Wildfire will bind to all network interfaces.
      Alternatively, you can specify a specific network interfaces that the server
      will listen on. For example, 127.0.0.1. This setting is generally only useful
       on multi-homed servers. -->
  <!--
    <network>
        <interface></interface>
    </network>
    -->
 <!-- Example LDAP settings -->
  <!-- Note, for Active Directory, try usernameField=sAMAccountName, nameField=displayName,
         emailField=mail -->
  <!--
    <ldap>
        <host></host>
        <port>389</port>
        <usernameField>uid</usernameField>
        <nameField>cn</nameField>
        <emailField>mail</emailField>
        <baseDN></baseDN>
        <adminDN></adminDN>
        <adminPassword></adminPassword>
    </ldap>
    <provider>
        <user>
            <className>org.jivesoftware.openfire.ldap.LdapUserProvider</className& gt;
        </user>
        <auth>
            <className>org.jivesoftware.openfire.ldap.LdapAuthProvider</className& gt;
        </auth>
    </provider>
    -->
  <!-- End example LDAP settings -->
  <connectionProvider>
    <className>org.jivesoftware.database.DefaultConnectionProvider</classN ame>
  </connectionProvider>
 <database>
    <defaultProvider>
      <driver>com.mysql.jdbc.Driver</driver>
      <serverURL>jdbc:mysql://localhost:3306/wildfire</serverURL>
      <username>######</username>
      <password>######</password>
      <minConnections>5</minConnections>
      <maxConnections>15</maxConnections>
      <connectionTimeout>1.0</connectionTimeout>
    </defaultProvider>
  </database>
  <setup>true</setup>
  <ldap>
    <host>192.168.1.20</host>
    <port>389</port>
    <baseDN>dc=mcs,dc=local</baseDN>
    <adminDN>#########</adminDN>
    <adminPassword>########</adminPassword>
    <connectionPoolEnabled>true</connectionPoolEnabled>
    <sslEnabled>false</sslEnabled>
    <ldapDebugEnabled>false</ldapDebugEnabled>
    <autoFollowReferrals>false</autoFollowReferrals>
    <usernameField>uid</usernameField>
    <searchFilter>(uid={0})</searchFilter>
    <vcard-mapping><![CDATA[
<vCard xmlns="vcard-temp">
  <N>
    <GIVEN>{cn} {telephonenumber}</GIVEN>
  </N>
  <EMAIL>
    <INTERNET/>
    <USERID>{mail}</USERID>
  </EMAIL>
  <FN>{cn} {telephonenumber}</FN>
  <ADR>
    <HOME/>
  </ADR>
  <ADR>
    <WORK/>
  </ADR>
</vCard>]]></vcard-mapping>
    <nameField>cn telephonenumber</nameField>
    <emailField>mail</emailField>
    <groupNameField>cn</groupNameField>
    <groupMemberField>uniquemember</groupMemberField>
    <groupDescriptionField>description</groupDescriptionField>
    <posixMode>false</posixMode>
    <groupSearchFilter>(&(objectClass=groupofuniquenames)(cn={0})(!(cn=Di rectory*)))</groupSearchFilter>
  </ldap>
  <provider>
    <vcard>
      <className>org.jivesoftware.openfire.ldap.LdapVCardProvider</className >
    </vcard>
    <user>
      <className>org.jivesoftware.openfire.ldap.LdapUserProvider</className& gt;
    </user>
    <auth>
      <className>org.jivesoftware.openfire.ldap.LdapAuthProvider</className& gt;
    </auth>
    <group>
      <className>org.jivesoftware.openfire.ldap.LdapGroupProvider</className >
    </group>
  </provider>
</jive>

 

 

 

Sean Moran Bronze 34 posts since
Dec 12, 2007
Currently Being Moderated
Mar 17, 2008 10:08 AM in response to: Brian Provenzano
Re: LDAP + Contact Display Name

Hey there,

 

I haven't tried to do this exactly, but I seem to remeber that the user roster is also cached on the client side. Have you tried this on a fresh install of spark or deleted the temporary data that spark stores? It definetly looks like you should be able to use any attribue you'd like from ldap to drive the user name on the roster.

 

If a fresh spark install still shows the default names I'll attempt to mock up a similar situation locally and see what I can find.

 

~Sean

AjsAjs Bronze 12 posts since
Sep 4, 2006
Currently Being Moderated
Apr 21, 2008 1:45 PM in response to: Brian Provenzano
Re: LDAP + Contact Display Name

 

If OpenFire just does an LDAP query using the specified LDAP attribute name and uses the result of the query to populate the attributes of an OpenFire user, e.g. display name.

 

 

Then it may be that what you are looking to do is not possible, i.e. trying to combine the results of two seperate queries into to one OpenFire/Spark user attribute.

 

 

What will work to satisfy your requirement is to create a new attribute on a LDAP user account that contains a combination of the display name and telephone number. (Or create a new LDAP attribute for each user.)

 

 

Then configure OpenFire to use (query) the LDAP attribute you have selected (that contains the custom display name/telephone number combination) and hence display what you wanted.

 

 

Will be interesting to see if anyone can offer another interpretation of how the LDAP query works.

 

 

 

 

Christian Flickinger Bronze 1 posts since
Jun 6, 2008
Currently Being Moderated
Jun 6, 2008 9:32 AM in response to: Brian Provenzano
Re: LDAP + Contact Display Name

 

It appears that you cannot combine multiple attributes into 1 field. The "displayName" in our Active Directory differs from the standard " " rule, which is why I was trying to get " " to display as the users nickname. THis does not work.

 

 

Hopefully this can be considered a bug/feature request. Allowing multiple attributes per field would be helpful.

 

 

More Like This

  • Retrieving data ...