title: Using OAuth 2 with CakePHP3
body: <p>I want to use an external Login (OAuth 2) with my CakePHP3 App. (The external Login need a Password and a Email). I never use an external Auth for my Applications (Everytime I use only my own Database with the Basic Auth of CakePHP3, so I have no clue what I should do)</p>
  
  <p>In my AppController I write this :</p>
  
  <pre><code> $this-&gt;loadComponent('Auth', [
  
   'authenticate' =&gt; [
     'Basic' =&gt; [
         'fields' =&gt; ['username' =&gt; 'email', 'password' =&gt;'password'],
     ], ],
  
       'loginAction' =&gt; [
                  'controller' =&gt; 'Users',
                  'action' =&gt; 'login'
              ]
          ]);
  
  $this-&gt;Auth-&gt;config('authenticate', 'OAuth2');
  </code></pre>
  
  <p>And in my OAuth2Authenticate.php</p>
  
  <pre><code>public function authenticate(Request $request, Response $response)
  {
      $http = new Client();
      $response = $http-&gt;get('http:xxx/login', [], [
          'auth' =&gt; ['username' =&gt; 'email', 'password' =&gt; 'password']
      ]);
  }
  </code></pre>
  
  <p>But I cannot get access to the User?</p>
  
  <p>Is there any helpful Tutorial out there or Examples where I can learn, to build up a external Login to CakePHP3?</p>