vikram
vikram

Reputation: 1

authentication in cakePHP

HI,

I have a problem with cake php built in auth - i cannot log in ...

1)user is added through app control pannel and hashed using $this->auth->password('xxx') - i've checked it's corrent in db

2)security salt is not emtpy

3) in action User/Login data['User']['password'] is empty, but in beforefilter() it is not empty.Main thing is its working on some machine.

4) db has table users with fields username and password and other fields.

After i'm trying to login a blank screen appears before me.

Upvotes: 0

Views: 338

Answers (3)

vindia
vindia

Reputation: 1678

Are you sure the hashes stored in the database are correct? Try to hash a password manually and see if it's equal to the one stored in the database. Cake will hash any form fields called password automatically using this->Auth->hashPassword, so if you're also hashing the password yourself, it gets hashed twice and that will not work.

Upvotes: 0

dogmatic69
dogmatic69

Reputation: 7585

Why are you using $this->Auth->password('xxx'); when cake infact does this automatically? are you hashing the hash?

can you link in some code as it should be very simple, eg: function login(){} and that works with AuthComponent.

Upvotes: 0

nageeb
nageeb

Reputation: 2042

The fact that it's only working on some machines, as you mentioned, would lead me to look at if the browser is storing the cookie. I believe after authentication, Cake will set a cookie, then attempt to retrieve it - possibly, unsuccessfully in this case.

Upvotes: 1

Related Questions