Email adress from user in Crowd custom directory not shown in Jira/Confluence user profile

Hi!

I created a custom directory connector which authenticates user against an external database. When I view the users in crowd, I see the correct email adress, but when I look at the profile of a user in Jira or Confleunce the email adress is not displayed.

Maybe I have to store it in a specific attribute ?

Any hints appreciated!

Regards,
Hans

Hi @computerpraxis

I am not sure how your implementation looks like, but I am guessing that you’ve implemented com.atlassian.crowd.directory.RemoteDirectory for your custom Crowd directory. How was searchUsers method implemented as this one takes important part in product to Crowd synchronization?
For the query that comes from Jira this method should be returning com.atlassian.crowd.model.user.User or com.atlassian.crowd.model.user.UserWithAttributes depending on what’s the return type in the query query.getReturnType() (parameter of searchUsers method)

Hope that helps,
Marcin Kempa

Hi Marcin!

Interestingly when I do a sync from my custom directory within Jira

image

which calls

…/jira/plugins/servlet/embedded-crowd/directories/sync?directoryId=10100&atl_token=3f650bcb8e4f4e56fff41bf0ce1716dc98c54246

the user profile in Jira contains the email-address.

After loging out and in again, the email-address is gone within the user profile and also the full name is not the actual value.

Maybe this is related to some kind of caching problem ?

I encounter this behaviour on 2 different Jira instances.

Regards,
Hans

Hi @computerpraxis

Is the behavior the same in Confluence? When you say you are logging out and login in again is that using the user account you are checking in the profile tab?

Cheers,
Marcin Kempa

Yes, same in Confluence.

I tried adding attributes “mail” and “displayName” and also “email” and “fullName” to my users but it is the same, when I log in with a user and look at the profile, no email address and wrong Fullname.

But in Crowd all user data is available.

  • Atlassian Crowd Version: 3.7.0 (Build:#1270 - 2019-10-03
  • Atlassian Jira (v7.12.3#712004-sha1:5ef91d7)
  • Atlassian Confluence 6.6.16

Regards,
Hans

This post shows a similar problem

Hi @computerpraxis

Can you see the email when you browse through users or is it only in profile. Also I would like to learn more about your setup. Here is how I understand it at the moment:

  1. You have Crowd instance with your custom directory
  2. There is a Jira instance connected to that Crowd and you are synchronizing users from there

What I do not know is how structure of directories looks like in Jira. I assume there must be an internal directory, but I am not sure what’s the order of directories in Jira nor I do not know if the user you are logging in to Jira exists in both of those directories (internal one and the one that points to Crowd).

Can you also check what is stored in Jira database, especially what do you see in cwd_table as this is the place where user data is being stored after synchronizing it with Crowd.

The article you’ve linked describes a problem with Bitbucket’s integration with LDAP which needs to have additional mapping of email address. In this case, since you are synchronizing users with Crowd there is no such need.

Regards,
Marcin Kempa

Hi Marcin!

Thank You for Your persistence and ongoing support!

We have a Jira and a Confluence Instance connected to Crowd (Bitbucket is also planed), both have an LDAP Directory and our Custom Directory configured.

I found the problem, it was related to my custom directory connector wrongly retrieving the user data.

I couldn’t find the Postgres DB Table “cwd_table” that You mentioned ?

Another question showed up:

The LDAP Connector caches user/group information within the database (cwd_user, cwd_group, cwd_membership) and I wonder how I could implement this functionality within my custom directory connector.

I suppose I would need to enable “Add User/Group” permission on my directory and use the Crowd REST API to add users/groups, do You have any hints on this topic ?

Regards,
Hans

Hi @computerpraxis

Sorry for misleading you… I meant cwd_user of course.

Regarding:

The LDAP Connector caches user/group information within the database (cwd_user, cwd_group, cwd_membership) and I wonder how I could implement this functionality within my custom directory connector.

You would like to have a caching mechanism for your custom directory in Crowd? Unfortunately it is more than just setting this permission as some additional implementation is required. I am not quite sure how easy it would be.

Cheers,
Marcin Kempa