You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Cyril FILLON <cy...@yahoo.fr.INVALID> on 2018/01/18 16:12:14 UTC

LDIF file import with userPassword based on SHA512 algorithm

Hello everyone,
I am using ApacheDS 2.0.0-M23.
I am currently loading programmatically an LDIF file with entries like:
dn: cn=Bilbo Baggins,ou=users,dc=mathworks,dc=com,o=Middle-earth
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: top
cn: Bilbo Baggins
description: Bilbo is the author of The Hobbit and translator of various "works from the elvish"
givenname: Bilbo
sn: Baggins
uid: bbaggins
mail: bbaggins@mathworks.com
userpassword: {SHA512}W3IrMH/ObJRJBdEyaR1eSiIUt/6StziSDrP846kEIKGVEcMBCg53ErBU2u9bV7rVnsvZOzKA8hBXj1R/Su1NJQ==
This hash corresponds to pass as password.However I perform a bind it fails.
If I used a SHA-1 hash as follows, it works fine:userpassword: {SHA}nU4eI71bcnBGqeO0t9tXvY1u5oQ=

I also tried with other prefixes like SHA-512, but it does not work as well.

Any ideas are most welcome. Many thanks in advance.



Cyril F

Re: LDIF file import with userPassword based on SHA512 algorithm

Posted by Emmanuel Lécharny <el...@gmail.com>.

Le 18/01/2018 à 17:38, Cyril FILLON a écrit :
> Hi all,
> Forget the previous request, I did a mistake in messing some configuration files.
> However, I have another request, I would like to export the content of my LDAP into an LDIF file programmatically.I almost achieve this but I miss a couple of things:1. I would like to ride of the operational attributes during the export2. 

If you don't request operational attributes (either explicitely or with
the special '+' element), you should not get back them.

What code are you using for the export ?

I would like to have the userPassword in the same form I entered in the
input ldif file, that is to say something like:userpassword:
{SHA512}W3IrMH/ObJRJBdEyaR1eSiIUt/6StziSDrP846kEIKGVEcMBCg53ErBU2u9bV7rVnsvZOzKA8hBXj1R/Su1NJQ==Currently
I am only able to a get byte array from the Attribute.


What you get is most certainly something like userpassword::<blah>,
where <blah> is the base 64 encoded of
{SHA512}W3IrMH/ObJRJBdEyaR1eSiIUt/6StziSDrP846kEIKGVEcMBCg53ErBU2u9bV7rVnsvZOzKA8hBXj1R/Su1NJQ==,
if I'm not wrong.


-- 
Emmanuel Lecharny

Symas.com
directory.apache.org


Re: LDIF file import with userPassword based on SHA512 algorithm

Posted by Cyril FILLON <cy...@yahoo.fr.INVALID>.
Hi all,
Forget the previous request, I did a mistake in messing some configuration files.
However, I have another request, I would like to export the content of my LDAP into an LDIF file programmatically.I almost achieve this but I miss a couple of things:1. I would like to ride of the operational attributes during the export2. I would like to have the userPassword in the same form I entered in the input ldif file, that is to say something like:userpassword: {SHA512}W3IrMH/ObJRJBdEyaR1eSiIUt/6StziSDrP846kEIKGVEcMBCg53ErBU2u9bV7rVnsvZOzKA8hBXj1R/Su1NJQ==Currently I am only able to a get byte array from the Attribute.

Any ideas are most welcome. Many thanks in advance.


Cyril F


    Le jeudi 18 janvier 2018 à 17:12:46 UTC+1, Cyril FILLON <cy...@yahoo.fr.INVALID> a écrit :  
 
 Hello everyone,
I am using ApacheDS 2.0.0-M23.
I am currently loading programmatically an LDIF file with entries like:
dn: cn=Bilbo Baggins,ou=users,dc=mathworks,dc=com,o=Middle-earth
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: top
cn: Bilbo Baggins
description: Bilbo is the author of The Hobbit and translator of various "works from the elvish"
givenname: Bilbo
sn: Baggins
uid: bbaggins
mail: bbaggins@mathworks.com
userpassword: {SHA512}W3IrMH/ObJRJBdEyaR1eSiIUt/6StziSDrP846kEIKGVEcMBCg53ErBU2u9bV7rVnsvZOzKA8hBXj1R/Su1NJQ==
This hash corresponds to pass as password.However I perform a bind it fails.
If I used a SHA-1 hash as follows, it works fine:userpassword: {SHA}nU4eI71bcnBGqeO0t9tXvY1u5oQ=

I also tried with other prefixes like SHA-512, but it does not work as well.

Any ideas are most welcome. Many thanks in advance.



Cyril F