ACL ERR_TOO_MANY_REDIRECTS

When user access unauthorized url in my application, CakePHP execute too many redirects.

I don't know why.

I try set the parameters unauthorizedRedirect and redirectUrl, but doesn't work.

AppController.php

public $components = array(
  'DebugKit.Toolbar',
  'Session',
  'Acl',
  'Auth' => array(
    'unauthorizedRedirect ' => false,
    'loginAction' => array('controller' => 'users', 'action' => 'login'),
    'authenticate' => array(
      'Form' => array(
        'userModel' => 'User',
        'fields' => array('username' => 'nickname', 'password' => 'password_hash')
      ),
    ),
    'authorize' => array(
      'Actions' => array('actionPath' => 'controllers/')
    )
    // 'authError' => 'This error shows up with the user tries to access a part of the website that is protected',
  )
);

Change this "actionPath" => "controllers/"

into this "actionPath" => "Controllers/"

I'm quite sure that you are on a case sensitive OS.

Another thing to setup it's the "loginRedirect" and the "logoutRedirect" statements: at the moment, if you login into the users/login action you will be redirected to the same action again and again. For a testing purpose I'd recommend you to set both of them to the root just adding this to your code:

'loginRedirect' => '/',
'logoutRedirect' => '/'

firstly check that is users/login action can display content to unauthorized user ? Use $this->Auth->allow(array('login', 'logout') in user controller. If you use Acl and Action authorize, check that anonymus has permission to see this user/login page.