[GH-ISSUE #45] What password encoding algorithm is used for hashing password? #25

Closed
opened 2026-02-27 16:47:42 +03:00 by kerem · 0 comments
Owner

Originally created by @micobarac on GitHub (Feb 13, 2023).
Original GitHub issue: https://github.com/rroemhild/docker-test-openldap/issues/45

# Hubert J. Farnsworth, people, planetexpress.com
dn: cn=Hubert J. Farnsworth,ou=people,dc=planetexpress,dc=com
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
cn: Hubert J. Farnsworth
sn: Farnsworth
description: Human
displayName: Professor Farnsworth
employeeType: Owner
employeeType: Founder
givenName: Hubert
mail: professor@planetexpress.com
mail: hubert@planetexpress.com
ou: Office Management
title: Professor
uid: professor
userPassword:: e3NzaGF9azRDRS9ta3Frb3NFampzVkhJWEhGMTFaU0h6ZVExUzdhdnQveWc9PQ=
    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth
            .ldapAuthentication()
            .userSearchFilter("(uid={0})")
            .userSearchBase("ou=people")
            .groupSearchFilter("(member={0})")
            .groupSearchBase("ou=people")
            .groupRoleAttribute("cn")
            .contextSource()
            .url("ldap://localhost:10389/dc=planetexpress,dc=com")
            .and()
            .passwordCompare()
            .passwordEncoder(new LdapShaPasswordEncoder())
            .passwordAttribute("userPassword");
    }

    @Bean
    BindAuthenticator authenticator(BaseLdapPathContextSource contextSource) {
        BindAuthenticator authenticator = new BindAuthenticator(contextSource);
        authenticator.setUserSearch(new FilterBasedLdapUserSearch("ou=people", "(&(uid={0})(objectClass=inetOrgPerson))", contextSource));
        return authenticator;
    }

When I try to login using professor: professor username and password, I get this error:

java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "encPass" is null

It looks like a LdapShaPasswordEncoder, but it doesn't work.

Originally created by @micobarac on GitHub (Feb 13, 2023). Original GitHub issue: https://github.com/rroemhild/docker-test-openldap/issues/45 ``` # Hubert J. Farnsworth, people, planetexpress.com dn: cn=Hubert J. Farnsworth,ou=people,dc=planetexpress,dc=com objectClass: inetOrgPerson objectClass: organizationalPerson objectClass: person objectClass: top cn: Hubert J. Farnsworth sn: Farnsworth description: Human displayName: Professor Farnsworth employeeType: Owner employeeType: Founder givenName: Hubert mail: professor@planetexpress.com mail: hubert@planetexpress.com ou: Office Management title: Professor uid: professor userPassword:: e3NzaGF9azRDRS9ta3Frb3NFampzVkhJWEhGMTFaU0h6ZVExUzdhdnQveWc9PQ= ``` ```java @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth .ldapAuthentication() .userSearchFilter("(uid={0})") .userSearchBase("ou=people") .groupSearchFilter("(member={0})") .groupSearchBase("ou=people") .groupRoleAttribute("cn") .contextSource() .url("ldap://localhost:10389/dc=planetexpress,dc=com") .and() .passwordCompare() .passwordEncoder(new LdapShaPasswordEncoder()) .passwordAttribute("userPassword"); } @Bean BindAuthenticator authenticator(BaseLdapPathContextSource contextSource) { BindAuthenticator authenticator = new BindAuthenticator(contextSource); authenticator.setUserSearch(new FilterBasedLdapUserSearch("ou=people", "(&(uid={0})(objectClass=inetOrgPerson))", contextSource)); return authenticator; } ``` When I try to login using professor: professor username and password, I get this error: `java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "encPass" is null` It looks like a LdapShaPasswordEncoder, but it doesn't work.
kerem closed this issue 2026-02-27 16:47:42 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-test-openldap#25
No description provided.