Bamboo and CrowdDirectoryService
Asked by Titus:

Hi,

is there a convinient way to get an instance of CrowdDirectoryService to check whether user can be synchronized against a Crowd instance.

The way via component and constructor injection like in Confluence does not work in Bamboo.

Try to get an instance via ContainerManager ends up in the error message, that no bean could be found:

```
final CrowdDirectoryService directoryService = (CrowdDirectoryService) ContainerManager.getComponent("CrowdDirectoryService");
```

```
[INFO] [talledLocalContainer] 2018-02-06 14:11:30,589 ERROR [http-nio-6990-exec-2] [[/bamboo]] Unhandled exception occurred whilst decorating page
[INFO] [talledLocalContainer] com.atlassian.spring.container.ComponentNotFoundException: Failed to find component: No bean named 'CrowdDirectoryService' is defined
[INFO] [talledLocalContainer] ?? ?at com.atlassian.spring.container.SpringContainerContext.getComponent(SpringContainerContext.java:79)
[INFO] [talledLocalContainer] ?? ?at com.atlassian.spring.container.ContainerManager.getComponent(ContainerManager.java:33)
[INFO] [talledLocalContainer] ?? ?at com.secsign.bamboo.util.SecSignIDStaticAccessor.getCrowdDirectoryService(SecSignIDStaticAccessor.java:57)
```

Cheers


Answers:
author: Marcin Kempa
body: Hi [@Titus](/t5/user/viewprofilepage/user-id/518692),

The reason why you are not able to get CrowdDirectoryService in Bamboo is that such service is not registered there. Bamboo does not come with embedded Crowd library to manage users it is using a different type of library to manage users, although it is possible to connect Bamboo to Crowd.

Could you shed some more light on what type of integration are you trying to build? Maybe there is another way we could help you achieve similar thing?

Best Regards,

Marcin Kempa

comments: author: Titus
body: Hi [@Marcin Kempa](/t5/user/viewprofilepage/user-id/671367)

actually we are building a two-factor auth add-on for Bamboo and Crowd. As the user getting and setting between Bamboo and Crowd is transparent we wanted to ensure that we dont work with old values from a cache or something else. Scince then we wanted to synchronise with the crowd instance manually as we do in our JIRA and Confluence add-on.

But your answers suggests that we just dont need that step.

Kind regards

Titus


author: Marcin Kempa
body: Hi [@Titus](/t5/user/viewprofilepage/user-id/518692),

Well my answer suggests that the integration between Bamboo and Crowd is different then with Jira, Confluence or Bitbucket server.

I am curious about how do you synchronize user in Jira and Confluence with Crowd? Also since Crowd can be connected to other directories as well, even if you synchronize Atlassian product with Crowd user may still not be synchronized with the remote LDAP dir. Could share more details about how this integration works?

Thanks,

Marcin Kempa


author: Titus
body: Hi [@Marcin Kempa](/t5/user/viewprofilepage/user-id/671367)

actually we try to keep the reading and writing of user data transparent and dont want to synchronize with an ldap manually.

Also we don't have to add a new field from Jira in Crowd because we are using one that already exists in our plugin (for the user to provide his SecSign ID / user name for the 2FA authentication). That way we are bypassing the issue of adding a field from Jira in Crowd or the sync from Crowd to the underlying active directory or ldap system.  

Our customers can use specific fields, for example if they are using fixed schemata in the Active Directory. This however needs custom setup the system.  

You can go ahead and try our SecSign ID 2FA for example with Jira to see how the authentication works. Maybe you have some ideas on how to improve the integration or user setup? Most of our customers are using an on-premise ID server with a connection to Crowd or another directory services.

Kind regards

Titus


Tags: bamboo

bamboo-development

crowd-development