0

Heloo I am new to Zend, I need to know how setCredentialTreatment() works. I am having salt stored for each entry in database and salt is used to encrypt password some thing like this


    sha1($password.$salt);

Can there be solution for directly concatenating query for password with salt and comparing without fetchin prior to authentication?

Thanks

Vedant Joshi
  • 173
  • 1
  • 6

2 Answers2

1

setCredentialTreatment('SHA1(CONCAT(?,salt));

This question was already answered on SO:

Zend_Auth setCredentialTreatment

How setCredentialTreatment works in Zend framework

Community
  • 1
  • 1
Volvox
  • 1,639
  • 1
  • 12
  • 10
0

Some thing like this:-

        $auth = Zend_Auth::getInstance();
        $authAdapter = new Zend_Auth_Adapter_DbTable(
            Zend_Db_Table::getDefaultAdapter(),
            'users',
            'username',
            'password',
            "CONCAT('$this->_salt', sha(?))"
        );
        $authAdapter->setIdentity($username)
            ->setCredential($password);

check this tutorial. http://blog.richardknop.com/2009/06/user-login-and-authentication-with-zend_auth-and-zend_acl/

Mubo
  • 1,078
  • 8
  • 16