Another back_sql problem: authentication

View: New views
2 Messages — Rating Filter:   Alert me  

Another back_sql problem: authentication

by Benedikt-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi list,

Just another quick question :)

Now I have back_sql working, I want to to binds to the specific users.
If I input the password in clear in my database, the bind authenticates
without any problems.

However, I would want to use a crypted password. For this, I have the
following code:

                         $user = "user_name";
                             $pw = "pass";
                     $salt = substr($user, 0, 2);
               $encrypted_password = crypt($pw, $salt);

It's a normal PHP crypt(), with the two first letters of the user name
being the salt.

In PHP I can do:

if (crypt($user_input, $encrypted_password) == $encrypted_password) {
   echo "Password verified!";
}

And the password gets verified. Is it possible to configure OpenLDAP to
authenticate this?

-  
Benedikt

This message is digitally signed by a PGP
key, to verify it's authenticity.

If you received this message without key
the message may not be authentic.

www.relamp.tk



---
You are currently subscribed to ldap@... as: [lists@...]
To unsubscribe send email to ldap-request@... with the word UNSUBSCRIBE as the SUBJECT of the message.

signature.asc (200 bytes) Download Attachment

Re: Another back_sql problem: authentication [SOLVED]

by Benedikt-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ignore this message, solved. I forgot I had to add {crypt} in front of
the password string, else it would try clear auth.

-  
Benedikt

This message is digitally signed by a PGP
key, to verify it's authenticity.

If you received this message without key
the message may not be authentic.

www.relamp.tk


On Sun, 2008-06-22 at 14:00 +0200, Benedikt Bär wrote:

> Hi list,
>
> Just another quick question :)
>
> Now I have back_sql working, I want to to binds to the specific users.
> If I input the password in clear in my database, the bind authenticates
> without any problems.
>
> However, I would want to use a crypted password. For this, I have the
> following code:
>
>                          $user = "user_name";
>                              $pw = "pass";
>                      $salt = substr($user, 0, 2);
>                $encrypted_password = crypt($pw, $salt);
>
> It's a normal PHP crypt(), with the two first letters of the user name
> being the salt.
>
> In PHP I can do:
>
> if (crypt($user_input, $encrypted_password) == $encrypted_password) {
>    echo "Password verified!";
> }
>
> And the password gets verified. Is it possible to configure OpenLDAP to
> authenticate this?
>
> -  
> Benedikt
>
> This message is digitally signed by a PGP
> key, to verify it's authenticity.
>
> If you received this message without key
> the message may not be authentic.
>
> www.relamp.tk
>


---
You are currently subscribed to ldap@... as: [lists@...]
To unsubscribe send email to ldap-request@... with the word UNSUBSCRIBE as the SUBJECT of the message.

signature.asc (200 bytes) Download Attachment
LightInTheBox - Buy quality products at wholesale price