LDAP Password re-check

I’m trying re-check the user authentication, I’m connect to Ldap and i need to confirm the user identity before some important actions in my application I already try PasswordEncryption methods but i figured out that only work with cuba internal authentication. Exist any similar method to test Ldap Password.

João Gomes


Take a look at com.haulmont.cuba.web.security.ldap.LdapLoginProvider class. It uses LdapTemplate from Spring LDAP.

You can use the same method to check your password in LDAP:

    protected boolean authenticateInLdap(LoginPasswordCredentials credentials) throws LoginException {
        String login = credentials.getLogin();
        String password = credentials.getPassword();

        return ldapTemplate.authenticate(LdapUtils.emptyLdapName(), buildPersonFilter(login), password);

Many thanks for your help.
Using your indication and more information about Spring LDAP i’m able to write a class to do the Job.

João Gomes