as part of our SAML SSO app, we allow to search for users in remote directories and trigger an update if we were able to find them.
Since Bamboo 9, when calling findUserByName on the Authoritative Directory, the lookup fails because of invalid credentials:
com.atlassian.crowd.exception.InvalidAuthenticationException: Application failed to authenticate
The code looks like this:
Directory directory = directoryManager.findDirectoryById(458758); RemoteDirectory remoteDirectory = directoryInstanceLoader.getDirectory(directory); RemoteDirectory authoritativeDirectory = remoteDirectory.getAuthoritativeDirectory(); User remoteUser = authoritativeDirectory.findUserByName("remote-jira-user");
We tried to debug this and saw two things:
When called from within our app, the directory password is encrypted, it starts with “BAMSCR…” and the code fails. We assume it fails because of the encrypted password.
But when called from an Arquillian test, the directory password is not encrypted and it works.
We would like to know how we can call findUserByName from within our app, such that the remote lookup works again or any alternatives that work for our use case.