A: 

If you are using CakePHP 1.2, you need to change:

$this->Auth->allow('home','register','activate','forgot','reset','_sendEmail','reset');

to

$this->Auth->allow(array('home','register','activate','forgot','reset','_sendEmail','reset'));

Notice the added "array()" in the allow function.

Jefe
oops sorry for that, but it still did not solve my problem
Shiv
are you including var $components = array('Auth')?In addition, I found this article to be a good solution to not using ACL:http://www.studiocanaria.com/articles/cakephp_auth_component_users_groups_permissions_revisited
Jefe
interesting...I will look through this article, and yes I have set the components variable
Shiv
Passing an array is not necessary. Look at the core function, you will see that it checks the number of arguments via func_get_args(), parsing all values as strings if that's how the app calls it.
Matt Huggins
@Matt - I guess they've changed the code since I read that article mentioned in earlier comments (http://www.studiocanaria.com/articles/cakephp_auth_component_users_groups_permissions_revisited). Oddly enough, when I take out that extra array, my code no longer works. When I put it back in, the code works.... I'm on 1.2.5
Jefe
A: 

Try $this->Auth->allowedActions = array('*'); in the controller's beforeFilter() (not in app_controller).

bLee
A: 

From the cookbook

By default, the AuthComponent expects you to have a table called 'users' with fields called 'username' and 'password' to be used.

I wonder if the automagic will work if you're using email as the field name?

Try adding this to your beforefilter.

    function beforeFilter() {
    $this->Auth->fields = array(
        'username' => 'email', 
        'password' => 'password'
        );
}
SteD
I had put this in already
Shiv
A: 

The way I solved this, and this is really a hack was I renamed the form field to password2, then Iin my controller method I set


$this->data['password] = $this->data['password2]

Then I called


$this->Auth->login($this->data)

and it seemed to work. I dont think this is the best way, however it worked and I will go with it till I find a better solution.

Shiv
Were you manually encrypting $this->data['password'] before the call before calling $this->Auth->login()? If so, you're issue is because the login method performs encryption of the password there too, so it's expecting it to be provided in plaintext.
Matt Huggins
A: 

i tried to use $this->auth->allow(array('index','view'));
but it's not working and i still have to authenticate !!!
any idea ?

running cakephp 1.2

The a in auth should be capital<pre><code>$this->Auth->allow(array('index','view'));</code></pre>
Shiv