title: Oauth authentication facebook - cakePHP plugin
body: <p>I am confused with this <a href="https://github.com/MozMorris/FacebookAuthenticate-CakePhp-Authentication-Handler" rel="nofollow">plugin</a>.</p>
  
  <p>Just copy-paste the demo, but I am getting this error when i am trying to connect with facebook:</p>
  
  <pre><code>The page isn't redirecting properly
  
  Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
  </code></pre>
  
  <p>full code:</p>
  
  <pre><code>&lt;?php
  
  class ExamplesController extends AppController {
  
    public $components = array(
      'Auth'=&gt; array(
        'loginAction' =&gt; array(
          'controller' =&gt; 'examples',
          'action'     =&gt; 'login'
        ),
        'loginRedirect' =&gt; array(
          'controller' =&gt; 'examples',
          'action'     =&gt; 'my_account'
        ),
        'authError' =&gt; 'Did you really think you are allowed to see that?',
        'authenticate' =&gt; array(
          'FacebookAuth.Facebook' =&gt; array(
            'fields' =&gt; array(
              'username' =&gt; 'email',
                  'password' =&gt; 'password'
            )
          )
        )
      )
    );
  
      public function index() {
      }
  
    public function beforeFilter()
    {
      parent::beforeFilter();
  
      $this-&gt;Auth-&gt;authenticate['FacebookAuth.Facebook']['application'] = array(
        'id'     =&gt; Configure::read('facebook.app_id'),
        'secret' =&gt; Configure::read('facebook.app_secret')
      );
  
      $this-&gt;Auth-&gt;allowedActions = array_merge($this-&gt;Auth-&gt;allowedActions, array('login'));
    }
  
    public function login()
    {
      if (!$this-&gt;Auth-&gt;login()) {
        /**
         * Get config for Facebook redirect
         */
        $clientId    = Configure::read('facebook.app_id');
        $permissions = implode(',', Configure::read('facebook.permissions'));
        $redirect    = Router::url(false, true);
        $csrfToken   = CakeSession::read('FacebookAuthCSRF');
  
        $this-&gt;redirect(Configure::read('facebook.oauth_dialg_url') . '?client_id=' . $clientId . '&amp;redirect_uri=' . $redirect . '&amp;scope=' . $permissions . '&amp;state=' . $csrfToken);
      } else {
        $this-&gt;redirect(array('action' =&gt; 'my_account'));
      }
    }
  
    public function my_account()
    {
      var_dump($this-&gt;Auth-&gt;user());
      die();
    }
  }
  </code></pre>
  
  <p>the challenge is to figure out how to put the plugin working.</p>
  
  <hr>
  
  <p><strong>UPDATE:</strong>
  Ok, i have this url  (thanks to elliot):</p>
  
  <pre><code>http://someHost/?client_id=4003xx16796&amp;redirect_uri=http://localhost/cake/users/login&amp;scope=email&amp;state=f96419881df77cdc689e6c43c131cf3b
  </code></pre>
  
  <p>Now, what is supposed to do with the url? The next step, basically. What I have is just a loggin button, that when clicked change the url, like the demo above, but without any action. The response is empty.</p>
  
  <p>I already read <a href="http://developers.facebook.com/docs/reference/dialogs/oauth/" rel="nofollow">this</a>.</p>