openldap-pbkdf2 | PBKDF2 for OpenLDAP | Identity Management library
kandi X-RAY | openldap-pbkdf2 Summary
kandi X-RAY | openldap-pbkdf2 Summary
openldap-pbkdf2
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of openldap-pbkdf2
openldap-pbkdf2 Key Features
openldap-pbkdf2 Examples and Code Snippets
Community Discussions
Trending Discussions on openldap-pbkdf2
QUESTION
We currently have a Keycloak realm where we want to export all existing users into LDAP (with their passwords intact), so we can add login support for other locations that don't support OpenID Connect or SAML, but do support LDAP.
Given that password credentials are stored in the Keycloak MySQL user database using the pbkdf2-sha256 algorithm, I had to use OpenLDAP 2.4.47 with the contrib modules to support this on the LDAP side as well (I also believe I've enabled this module in the configuration).
I'm having trouble transferring the existing has (from Keycloak) to LDAP using the format described here: https://github.com/hamano/openldap-pbkdf2
Forgive me for using PHP, but it's the programming language I'm most comfortable with at this time.
I've tried using the HASH_ITERATIONS, SALT, and VALUE fields, along with the base64url_encode custom function provided in the comments under base64_encode in the PHP manual, to make an "Adapted Base64" string, and provide the built string as the userPassword field when creating an LDAP user. The user is successfully created in LDAP, but I'm unable to authenticate against LDAP using the credentials for the user I've just created.
...ANSWER
Answered 2019-Jun-25 at 12:51Quick update: I managed to find a solution together with one of my excellent colleagues, and I wanted to post the solution here, for future reference if anyone else get stuck on this.
We found out that the key length used for hashing in Keycloak was 64 bytes, no matter which algorithm was used. This also meant that the byte sequence of the hash is repeated for those algorithms that have a default key length that is shorter than 64 bytes (to make it exactly 64 bytes long). In PBKDF2, the default key length for SHA-1 is 20 bytes, it's 32 bytes for SHA-256, and 64 bytes for SHA-512. This allowed me to make the following PHP function that returns the exact same type of string returned by slappasswd:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install openldap-pbkdf2
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page