LDAP User Repository
When users are primarily managed in LDAP, they can be placed in the application where you need to choose a user or find a user in SuggestionField. For this purpose, the addon comes with the LDAP implementation of UserRepository. This user repository provides access to users from LDAP, but it does not provide the system or anonymous user. Also, you may want users from the database to be searchable as well.
To achieve this, declare the CompositeUserRepository bean, which comprises all instances of UserRepository in the application, for example, LdapUserRepository and DatabaseUserRepository. Make this UserRepository primary in the application:
@Bean
@Primary
UserRepository userRepository() {
return new CompositeUserRepository();
}
Was this page helpful?
Thank you for your feedback