Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,022
Community Members
 
Community Events
176
Community Groups

What is the right way to implement findUserByName method of RemoteDirectory?

Edited

Hello, 

I am learning and working in Java for the first time in order to create a Custom Directory in Crowd.  When I configured Jira to connect to Crowd, one of the first methods that I saw it calls is findUserByName with username as parameter.  The return type of the method is User (com.atlassian.crowd.model.user.User) which also I implented with required methods.  I fetch the required fields of User object (ExternalId, EmailAddress, FirstName and LastName) using the username parameter, and return the User object.  Crowd then calls the same method twice again but with the user's full name as the parameter.  

For instance, the username is "jdoe", and during the first call I get the first name "John", last name "Doe", email address of "jdoe@xyz.com" and external Id of 25, and return this object.  Crowd then calls the same method with username of "John Doe".  My code fails to find a user with username "John Doe".  Does anyone know how these methods are to implemented please?

I do not find documentation on how each method should be implemented - an explanation of the context in which each method would be called and the purpose of each method.  The page, "https://docs.atlassian.com/atlassian-crowd/current/com/atlassian/crowd/directory/RemoteDirectory.html" lists all methods and their signatures with one short line description. But that is not sufficient.  In case of findUserByName method, the page does not explain the behaviour I see.  Help please!

Rizwan

1 answer


I solved this particular issue. The error was in my implementation of User interface (com.atlassian.crowd.model.user.User), not in the implementation of findUserByName method of RemoteDirectory interface. The return value of my "public String getName()" method in User interface implementation was firstName + " " + lastName. I misunderstood what getName() was supposed to return. It needs to return the username, and that way Crowd gets the username correctly by calling that method.

 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events